Re: [R] general linear model and generalized linear model

From: Tobias Verbeke <tobias.verbeke_at_telenet.be>
Date: Sat 01 Jul 2006 - 18:58:58 EST


>----- Oorspronkelijk bericht -----
>Van: zhijie zhang [mailto:epistat@gmail.com]
>Verzonden: zaterdag, juli 1, 2006 08:50 AM
>Aan: r-help@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@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
>
>



R-help@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 Received on Sat Jul 01 19:09:39 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 02 Jul 2006 - 00:13:46 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.