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

Philipp Pagel p.pagel at wzw.tum.de
Tue Feb 24 12:08:10 CET 2009

On Tue, Feb 24, 2009 at 02:46:07AM -0800, Saeed Ahmadi wrote:
> 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")

That should work. Maybe you should tell us what happened or why you
think it didn't work. Error messages? Unexpected results?


Dr. Philipp Pagel
Lehrstuhl für Genomorientierte Bioinformatik
Technische Universität München
Wissenschaftszentrum Weihenstephan
85350 Freising, Germany

More information about the R-help mailing list