[R] quesion about lm function

meng laomeng_3 at 163.com
Sat Mar 9 11:35:27 CET 2013


Hi all:
My data is in the attachment.
I want to analysis the mean difference of y between 2 sex.
 
My code:
result_lm<-lm(y~factor(sex) + x1 + x2)
summary(result_lm)

The result of "factor(sex)m" 136.83, is the mean difference of y between 2 sex,and the corresponding p value is 0.07618.
 
My question is: how to get the mean y of sex(m) and sex(f) respectively via lm function?
 
Many thanks for your help.
My best.

 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: dat.txt
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130309/ed591f9a/attachment.txt>


More information about the R-help mailing list