Use this to calculate the logit, b0 + b1*mean(Age) + b2*New + b3*Treated, under the different scenarios for New and Treated. Then transform the logit to get probabilities, p(high Dieldrin) = 1/(1 + exp(-logit)). You just need a calculator for this!
a) la <- b0 + b1*Age + b2*0 + b3*0 b) lb <- b0 + b1*Age + b2*1 + b3*1and then transform to probabilities as in 7, pa = 1/(1 + exp(-la)) and pb = 1/(1 + exp(-lb)), Like so:
data sasuser.rwg244; set sasuser.rwg244; la = -8.9734 + 0.2084*age; lb = -8.9734 + 0.2084*age +2.1408 + 2.5972; pa = 1/(1 + exp(-la)); pb = 1/(1 + exp(-lb)); run;Now, to get the Conditional Effects Plot, Submit the following:
title1 'Conditional Effects Plot'; footnote1 f=special 'J J J' f=swiss ' Old Suburb, No Treatment'; footnote2 f=special 'D D D' f=swiss ' New Suburb, Treated'; symbol1 c=black i=splines value=dot; symbol2 c=black i=splines value=diamond; axis1 label=('Age'); axis2 label=('High' justify=left 'Dieldrin'); proc gplot data=sasuser.rwg244; plot pa*age pb*age/overlay haxis=axis1 vaxis=axis2; run;This is like the plot commands we did last week!
Now, you are ready to construct your diagnostic variables. This requires some code to be entered into the Program Editor. First thing to do is to save your dataset under a new name (I used bob). Then, exit INSIGHT and Submit the following lines:
data sasuser.bob; set sasuser.bob; deltaxp = rps_diel**2/(1-h_dieldr); deltaxd = rds_diel**2/(1-h_dieldr); deltab =((rps_diel)**2*h_dieldr)/(1-h_dieldr)**2; run;10a, is a pretty simple plot, but b & c require some SAS code to make the bubbles. Here's how to do it:
For 10b: title1 'Bubble Plot'; footnote1 ' '; footnote2 ' '; proc gplot data=sasuser.bob; bubble deltaxp*p_dieldr=deltab; run;Now, a similar idea for problem 10c:
For 10c: proc gplot data=sasuser.bob; bubble deltaxd*p_dieldr=deltab; run;