Date: Mon, 23 Feb 2009 09:45:19 -0600 Robin R High "SAS(r) Discussion" Robin R High Re: Proc Mixed Pre/Post-test To: Thomas Schmitt <181975.94849.qm@web82901.mail.mud.yahoo.com> text/plain; charset="US-ASCII"

Tom,

If you only have pre and post test results (with no grouping variable), there are a couple of ways to proceed. One is to compute the paired differences and run what is essentially a ttest of the mean=0. This assumes complete data. If you have missing values, on pre or post, need to modify accordingly

proc sort data=hlm2; by id time; RUN;

DATA diffs; SET hlm2; BY id; retain y1; DROP pcl; if first.id then y1=pcl; if last.id then do; y2=pcl; diff12=y1-y2; output diffs; end;

ods select covparms solutionF;

proc mixed data=diffs ; model diff12 = / solution ; run;

* or with PROC TTEST on the actual values;

proc ttest data=diffs; paired y1* y2; run;

or run the results on the dataset with the actual values for time 1 and 2 in univariate form (again assume complete data):

ods select lsmeans diffs; ods output covparms=cvp;

proc mixed data=hlm2 ; class time; model pcl = time / ddfm=bw; REPEATED time / subject=id type=un r; LSMEANS time / diff; run;

PROC TRANSPOSE DATA=cvp out=tr_c prefix=_vr; var estimate; run;

data tr_c; SEt tr_c; vr_diff = _vr1 +_vr3 - 2*_vr2;

PROC PRINT DATA=tr_c; run;

With complete data, you should see the variance of the difference (vr_diff) is the same as the residual variance from the analysis of the paired differences.

Robin High UNMC

Thomas Schmitt <schmitta1573@YAHOO.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 02/20/2009 01:20 PM Please respond to Thomas Schmitt <schmitta1573@YAHOO.COM>

To SAS-L@LISTSERV.UGA.EDU cc

Subject Proc Mixed Pre/Post-test

Hello SASers,

I'm using PROC MIXED for a pre/post-test design. When I run the analysis the number of "observations used" is less than the number of "observations read." Data is only missing at the post-test. It looks like the observations with missing post-test data is being listwise deleted as opposed to used when the mixed model is fit to the data. Also, do the fixed effect benefit from the modeling of the full information like the random effects do? The degrees of freedom seem to indicate no. The code I've been working with are below along with the output. What I'm interested in are the fixed effects. Any help is appreciated. Thanks!

Best,

Tom

proc mixed data=hlm2 covtest; class id; model pcl=time /solution ddfm=bw; random intercept time/type=un subject=id; run;

Solution for Fixed Effects

Standard Effect Estimate Error DF t Value Pr > |t| Alpha

Intercept 44.4000 2.1964 39 20.22 <.0001 0.05 time -23.7131 2.1106 27 -11.24 <.0001 0.05

Back to: Top of message | Previous page | Main SAS-L page