Re: [R] need help with understanding stepAIC

From: ONKELINX, Thierry <Thierry.ONKELINX_at_inbo.be>
Date: Thu, 03 Apr 2008 10:15:20 +0200

Dear Balavelan,

First I would suggest to include the main effects of all variables in an interaction. So you model with interaction should be y ~ a + b + c + d + c:d. Which can be abbreviated to y ~ a + b + c*d.

Futhermore you should take a look at ?predict.glm and pay attention to the newdata and type = "reponse" arguments.

HTH, Thierry




ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest
Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance
Gaverstraat 4
9500 Geraardsbergen
Belgium
tel. + 32 54/436 185
Thierry.Onkelinx_at_inbo.be
www.inbo.be

To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of.
~ Sir Ronald Aylmer Fisher

The plural of anecdote is not data.
~ Roger Brinner

The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey

-----Oorspronkelijk bericht-----
Van: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] Namens Bala Thanigaivelan
Verzonden: donderdag 3 april 2008 4:22
Aan: r-help_at_r-project.org
Onderwerp: [R] need help with understanding stepAIC

Hi,

I am currently using R extensively to develop a statistical model and currently learning its capabilities.

I am trying to develop a logistic regression model using glm and stepAIC

I constructed my formula as y ~ a + b + c + d

Now I wish to study the interaction between variables. So I did y ~ a + b + c:d + d

The software generated the coefficients for a, b , c:d, d

Now I want to compute the probability for various events using the logistic regression model formula

  Prob = exp(y)/(1+exp(y))

How do I compute the value of y for the formula with interaction variables ? what does c:d represent given a dataset ?

Regards,

Balavelan

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 03 Apr 2008 - 08:19:24 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 03 Apr 2008 - 08:30:25 GMT.

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

list of date sections of archive