Date: Mon, 31 Oct 2011 18:16:05 -0400 Peter Flom "SAS(r) Discussion" Peter Flom Re: GML in SAS and R To: oslo <1320097685.4930.YahooMailNeo@web161403.mail.bf1.yahoo.com> text/plain; charset="iso-8859-1"

I ran both this in both SAS and R and got identical results, with no parameter fixed at 0.

In SAS

proc glm data = a; model y = t; run;

in R

y <- c(8.45868914, 8.80001656, 11.19760853, 6.48274648, 4.13212718, 2.56846860, 0.93439027, 10.42572772, 3.37216466, 7.97682921, 3.90145850, 1.42026869, 8.19922699) t <- c(48, 28, 35, 15, 21, 50, 31, 46, 40, 26, 48, 32, 15)

m1 <- lm(y ~ t) summary(m1)

Peter

Peter Flom Peter Flom Consulting http://www.statisticalanalysisconsulting.com/ http://www.IAmLearningDisabled.com

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of oslo Sent: Monday, October 31, 2011 5:48 PM To: SAS-L@LISTSERV.UGA.EDU Subject: GML in SAS and R

Dear SAS-users;

I have run the same data in R and SAS but got different prediction results after model fit. Suppose I want fit the following model for the data given below (a part of data)

y(ij)=mu + t(i) + e(ij)

at the end I want to have

y* =y(ij)-t(i)_hat For this I run SAS and R but got differnt results.SAS and R are using different constrain on fixed effect. In SAS the last effect, in R the first fixed effect set to zero.

In addition is it possible to set the first fixed effect to zero in SAS as R does?

Regards,

Oslo data a; input y t; cards; 8.45868914 48 8.80001656 28 11.19760853 35 6.48274648 15 4.13212718 21 2.56846860 50 0.93439027 31 10.42572772 46 3.37216466 40 7.97682921 26 3.90145850 48 1.42026869 32 8.19922699 15

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