Re: [R] analogue of group option of SAS MIXED/random in R

From: Bruno L. Giordano <bruno.giordano_at_music.mcgill.ca>
Date: Tue 04 Jul 2006 - 15:30:03 EST

Well,
just in case somebody is interested, the following R code gives the same estimates as the SAS code below:

######R code###########

G.Data<-groupedData(Response~1|Subject,data=In.Data)
G.Data$Condition<-as.ordered(G.Data$Condition)
G.Data$Const<-rep(1,length(Variable1))

tmp<-pdDiag(~Condition:Const+Condition:Variable1+Condition:Variable2-1) Fit1<-lme(Response~1+Variable1+Variable2*Condition, random=tmp,
method="REML",data=G.Data)

########SAS code########
proc mixed data=InData;class Subject Condition; model Response=Variable1 Variable2 Condition Variable2*Condition; random int Variable1 Variable2/subject = Subject group=Condition type=vc; run;

    Bruno

> Dear list,
>
> I am trying to use lme to build the analogue of the following SAS MIXED
> random specification:
>
> random int+Variable1+Variable2 /subject = Subject group=Condition type=vc;
>
> which gives a Condition-blocked heterogeneity in the random effects
> variance-covariance matrix.
>
> Needless to say, I have a hard time in specifying Condition-specific
> heterogeneities in the variance-covariance parameters.
>
> I initially tried the following commands (without Condition-heterogeneity
> in
> the random effects):
>
> G.Data<-groupedData(Response~1|Subject,data=In.Data)
> Fit1<-lme(Response~1+Variable1+Variable2*Condition,random=pdDiag(~1+Variable1+Variable2),method="REML",data=G.Data)
>
> but have no idea about where to go from here (note that I don't want to
> nest
> Subject in Condition).
>
> Thanks!!
>
> Bruno
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>



Bruno L. Giordano, PhD
CIRMMT
Schulich School of Music, McGill University 555 Sherbrooke Street West
Montréal, QC H3A 1E3
Canada
http://www.music.mcgill.ca/~bruno/

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 04 15:37:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 04 Jul 2006 - 18:15:01 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.