# RELATING THE NUMBER OF TV'S TO LIFE EXPECTANCY # ============================================== # FIRST, make sure Desktop is your default directory # NEXT, read in datafile TVlife06.txt using read.table() command # and call the table tvlife # NEXT, give column names to replace V1, V2, and V3 by using colnames() # NEXT, make variable tvlife[,2] be life # and variable tvlife[,3] be TV # and make variable called logTV be log(TV) # and variable called loglife be log(life) # remember that log() is the natural log # NEXT, run linear model of life on TV # and call it model10 # also make summary of model10 # and scatterplot with best fit line on it # and make residual plot with x axis on it # NEXT, run linear model of loglife on TV # (which is loglife ~ TV) # and call it model20 # get scatterplot and summary stats on model20 # which has line of best fit on it. # Also get residual plot of model2 with x axis on it # NEXT, run linear model of loglife on logTV # and call it model30 # Include summary and scatter plot, # with line on plot # and residual plot with 0 line on plot # NEXT, run linear model of life on logTV # include scatterplot with line on it # and summary and residual plot with x axis on it. # Call the model model40