Hello: I have a 4-column dataset: Crime, Education, Urbanization, Age. I want to construct a multiple linear regression to find the effect of Education, Urbanization, and Age on Crime" lm(Crime ~ Education + Urbanization + Age) If I use + in above statement, does it mean it will build a model to find the relationship between Crime and Education when Urbanization and Age are held constant? What would be the difference if I drop the term Urbanization + Age ? lm(Crime ~ Education) Regards: John [[alternative HTML version deleted]]
Hi, Did you read the help file? Particularly the section "Details". ?lm Regards, Pascal Le 15/02/2013 08:55, email a ?crit :> Hello: > > I have a 4-column dataset: Crime, Education, Urbanization, Age. I want to > construct a multiple linear regression to find the effect of Education, > Urbanization, and Age on Crime" > > lm(Crime ~ Education + Urbanization + Age) > > If I use + in above statement, does it mean it will build a model to find > the relationship between Crime and Education when Urbanization and Age are > held constant? > > What would be the difference if I drop the term Urbanization + Age ? > > lm(Crime ~ Education) > > Regards: > John > > [[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. >
> >You could also run it and find out..... There are many R tutorials free online. I presume crime is continuous, as well...? ~Nicole Ford Graduate Instructor Department of Government and International Affairs University of South Florida office: SOC 012M e: nmhicks@mail.usf.edu http://gia.usf.edu/student/nford/ Sent from my iPhone [[alternative HTML version deleted]]
You will also need to specify/ name your model: Mod <- lm(Crime~......... ~Nicole Ford Graduate Instructor Department of Government and International Affairs University of South Florida office: SOC 012M e: nmhicks@mail.usf.edu http://gia.usf.edu/student/nford/ Sent from my iPhone On Feb 14, 2013, at 6:55 PM, email <email8889@gmail.com> wrote:> Hello: > > I have a 4-column dataset: Crime, Education, Urbanization, Age. I want to > construct a multiple linear regression to find the effect of Education, > Urbanization, and Age on Crime" > > lm(Crime ~ Education + Urbanization + Age) > > If I use + in above statement, does it mean it will build a model to find > the relationship between Crime and Education when Urbanization and Age are > held constant? > > What would be the difference if I drop the term Urbanization + Age ? > > lm(Crime ~ Education) > > Regards: > John > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@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.[[alternative HTML version deleted]]
Smells like homework to me. If so, we don't do homework on this list. -- Bert On Thu, Feb 14, 2013 at 3:55 PM, email <email8889 at gmail.com> wrote:> Hello: > > I have a 4-column dataset: Crime, Education, Urbanization, Age. I want to > construct a multiple linear regression to find the effect of Education, > Urbanization, and Age on Crime" > > lm(Crime ~ Education + Urbanization + Age) > > If I use + in above statement, does it mean it will build a model to find > the relationship between Crime and Education when Urbanization and Age are > held constant? > > What would be the difference if I drop the term Urbanization + Age ? > > lm(Crime ~ Education) > > Regards: > John > > [[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.-- Bert Gunter Genentech Nonclinical Biostatistics Internal Contact Info: Phone: 467-7374 Website: http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm