# Open the data file, attach it, and look at the variables.
ObIn2010<-read.csv("~/Documents/Data/GregGiniOb3.csv")
attach(ObIn2010)
summary(ObIn2010)
# Calculate the least squares regression model to predict
# the adult obesity rate in 2010. The independent variables
# are inequality (measured by the household gini coefficient)
# and the percent conservative (self-identify).
summary(lm(ob10~hgini10+con))
# Let's look at another example using the
# Children of Immigrants Longitudinal Study (CILS).
CILS<-read.csv("http://www.courseserve.info/files/CILS2010.csv")
attach(CILS)
summary(CILS)
# We'll try to predict educational aspiration.
summary(lm(V60~V18+V36+V57+V44))