Skip to main content
deleted 1 character in body
Source Link

when I run the following model lm(y~A*B, data=ex2) (where A and B are categorical variables) and compare it to the output from SAS (using a type III Anova and the same referent levels), I get the same mean sums of squaresleast squared means, CIs and Anova output to the decimal, however my co-efficients are off and I have smaller SEs in R. Since SAS uses ML and R uses OLS I am thinking this may be the reason, am I able to change the default of lm to ML? Any other suggestions? Thanks. CB

when I run the following model lm(y~A*B, data=ex2) (where A and B are categorical variables) and compare it to the output from SAS (using a type III Anova and the same referent levels), I get the same mean sums of squares, CIs and Anova output to the decimal, however my co-efficients are off and I have smaller SEs in R. Since SAS uses ML and R uses OLS I am thinking this may be the reason, am I able to change the default of lm to ML? Any other suggestions? Thanks. CB

when I run the following model lm(y~A*B, data=ex2) (where A and B are categorical variables) and compare it to the output from SAS (using a type III Anova and the same referent levels), I get the same least squared means, CIs and Anova output to the decimal, however my co-efficients are off and I have smaller SEs in R. Since SAS uses ML and R uses OLS I am thinking this may be the reason, am I able to change the default of lm to ML? Any other suggestions? Thanks. CB

Source Link

I am trying to replicate a linear regression model in R that was run in SAS

when I run the following model lm(y~A*B, data=ex2) (where A and B are categorical variables) and compare it to the output from SAS (using a type III Anova and the same referent levels), I get the same mean sums of squares, CIs and Anova output to the decimal, however my co-efficients are off and I have smaller SEs in R. Since SAS uses ML and R uses OLS I am thinking this may be the reason, am I able to change the default of lm to ML? Any other suggestions? Thanks. CB