[R] LMER vs PROC MIXED estimates
sandip1006
sandip.1006 at gmail.com
Wed Nov 7 04:00:50 CET 2012
Hi experts,
I have just about started to use R (after using SAS for more than 5 years)
and still finding my way...I have been trying to replicate PROC MIXED
results in LMER but noticed that the estimates are coming different.
My SAS code is as follows (trying to randomise X2 and Intercept):
PROC MIXED DATA = <DATASET NAME> NAMELEN=100 METHOD=REML MAXITER=1000;
CLASS GEOGRAPHY;
MODEL y = X1 X2 X3/SOLUTION;
RANDOM INTERCEPT X2/SOLUTION SUBJECT = GEOGRAPHY;
ODS OUTPUT SOLUTIONR=RANDOM_EFFECT;
ODS OUTPUT SOLUTIONF= FIXED_EFFECT;
RUN;
the equivalent code that I was writting in R is as follows:
testdata <- read.csv("adstest.csv",header=TRUE,sep=",")
attach(testdata)
library(lme4)
options(contrasts = c(factor = "contr.SAS",ordered = "contr.poly"))
lmm.2=lmer(y~X1+X2+X3 + (X2|Geography),REML=TRUE,data=bigads)
I am not sure if I have got the R script/options correct...but I seem to be
getting different estimates from the same dataset....
any help on this would be highly appreciated!!!!
--
View this message in context: http://r.789695.n4.nabble.com/LMER-vs-PROC-MIXED-estimates-tp4648653.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list