[R] Syntax in taking log to transfrom the data to fit Gaussian distribution

Saeed Ahmadi ahmadi_saeed at yahoo.com
Tue Feb 24 11:46:07 CET 2009


Hi,

I have a data set (weight) that does not follow the Gaussian (Normal)
distribution. However, I have to transform the data before applying the
Gaussian distribution. I used this syntax and used log(weight) as:
posJy.model<-glm(log(weight) ~ factor(pos),
family=gaussian(link='identity'), subset=Soil=="Jy"). This syntax COULD NOT
transform the data. But if I transform the data before applying the model,
then it works. The syntax is: 

weight<-log(weight)
posJy.model<-glm(weight ~ factor(pos), family=gaussian(link='identity'),
subset=Soil=="Jy")


What is wrong with the first syntax. I have seen many scripts that the R
users have applied any function (log, -, ...) directly inside the
formulation. 

It will help me to understand the grammar of R.

Thank you.
Saeed




-- 
View this message in context: http://www.nabble.com/Syntax-in-taking-log-to-transfrom-the-data-to-fit-Gaussian-distribution-tp22179656p22179656.html
Sent from the R help mailing list archive at Nabble.com.




More information about the R-help mailing list