[R] general linear model and generalized linear model

Tobias Verbeke tobias.verbeke at telenet.be
Sat Jul 1 10:58:58 CEST 2006


>----- Oorspronkelijk bericht -----
>Van: zhijie zhang [mailto:epistat at gmail.com]
>Verzonden: zaterdag, juli 1, 2006 08:50 AM
>Aan: r-help at stat.math.ethz.ch
>Onderwerp: [R] general linear model and generalized linear model
>
>Dear friends,
>  I searched the R site and found a lot of results on general linear model
>and generalized linear model , and i was confused by them. Here, I only want
>to get some concise answers on the following questions and i'll study it by
>your hints:
> 1. Which function(package) could be used to fit the general linear model ?

Function lm from the stats package (which comes with R).
See ?lm

>2. Which function(package) could be used to fit the generalized linear model
>?

Function glm from the stats package.
See ?glm

Chapter 11 of `An Introduction to R' (which comes with R and 
is available on CRAN) is devoted to statistical models in R
and has sections on linear models and generalized linear models.
Cf. http://cran.r-project.org/manuals.html

>3. How to tell them which variables in my dataset are categorical variables
>that will be used as dummy variables?

You should (only) make sure these variables are so-called factors 
(which is the way R represents categorical variables). 
Chapter 4 of `An Introduction to R' is entirely devoted to factors.

HTH,
Tobias

>Thanks very much!
>
>
>-- 
>Kind Regards,
>Zhi Jie,Zhang ,PHD
>Department of Epidemiology
>School of Public Health
>Fudan University
>Tel:86-21-54237149
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help at stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>
>



More information about the R-help mailing list