[R-sig-ME] sas to R
Steve Hong
emptican at gmail.com
Tue Jun 26 16:09:15 CEST 2012
Thank all of you.
Ben and Kevin, you were right! The main reason of my problem that I
experienced was not specifying factors (i.e., trial and block)...
Once I factorized them, I was able to run the models with both lme and
lmer in the SAME R session. I think it was possible since I did not
use functions in lmer such as lmList. Also, the results, especially
df and F-stats, were same or very close to results from SAS. I
greatly appreciate all of your kind/patient suggestions.
Thank you again!!!
Steve
On Tue, Jun 26, 2012 at 2:10 AM, Ben Bolker <bbolker at gmail.com> wrote:
> Steve Hong <emptican at ...> writes:
>
>>
>> Thank you, all.
>>
>> I restarted R and checked package list using 'search()'. And then,
>> loaded 'lme4' and ran the model. However, the results are same...
>>
>> Below is what I did.
>>
>> Thank you much again!!!
>>
>> Steve
>
> As Kevin Wright said:
>
> Make sure that trial, block, trt are factors,
> [snip snip snip]
>
>
>> > bcwrear1 <- read.table("C:/bcwrear1.txt", header=T)
>> > df <- bcwrear1
>> > df=bcwrear1
>> > df=transform(df, y=day10, trt=turf)
>
>
> df <- transform (trial=factor(trial), block=factor(block), trt=factor(trt))
>
>> > fm.lmer <- lmer(log10(y) ~ trt + (1|trial/block/trt), data=df,
> na.action=na.omit)
>
>
> [snip snip snip]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
More information about the R-sig-mixed-models
mailing list