Re: [R] Is this correct?

From: <Bill.Venables_at_csiro.au>
Date: Mon, 24 Nov 2008 15:50:19 +1100

R help does have guidelines. (See the bottom of any message to R help, including yours.) Here is a relevant extract from them:

"Basic statistics and classroom homework: R-help is not intended for these."

Your questions are entirely inappropriate.

It would also be courteous if we knew your name and not just an alias.

Bill Venables
http://www.cmis.csiro.au/bill.venables/

-----Original Message-----
From: r-help-bounces_at_r-project.org [mailto:r-help-bounces_at_r-project.org] On Behalf Of Rlover Sent: Monday, 24 November 2008 12:46 PM
To: r-help_at_r-project.org
Subject: [R] Is this correct?

I have to answer the following question for a homework assignment.

A researcher was interested in whether people taking part in sports at university made more money after graduating, taking into account the students' GPA. They sampled 200 alumni from a large university. The variables are: income (income 10 years after graduating), sports (1 if they did sports, 0 if they did not), and GPA (the grade point average at university). Discuss the relationship between taking part in sports, GPA, and income for these data.

The R code I used so far is

Does sports predict GPA?

> lm1<-lm(GPA~sports)
> summary(lm1)

Does sports predict income?
> lm2<-lm(income~sports)
> summary(lm2)

Does GPA predict income?
> lm3<-lm(income~GPA)
> summary(lm3)

Does sports predict income after accounting for GPA?
> lm4<-lm(income~GPA+sports)
> summary(lm4)

Can someone let me know is the above is correct? I am not sure if to keep all four regressions or only 1 and 4. Also, I need to plot the data on a graph or table. Can anyone suggest how to do this? Thank you in advance :)

--
View this message in context: http://www.nabble.com/Is-this-correct--tp20654004p20654004.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
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 Mon 24 Nov 2008 - 04:54:21 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 Mon 24 Nov 2008 - 05:30:28 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