#####################################
QUESTIONS
#####################################
#Question 1
#Use(mtcars)
data(mtcars)
#Explore data
#create an object with only weight, horsepower and mpg
#obtain descriptives for weight, horse power and mpg
#show histograms for weight and hp
#find variance, covariance and correlation for wt and hp
#plot scatterplot for weight and hp and show regression line.
#add lines showing the residual's distance to the predicted line on the scatterplot
#is the correlation signficant?
#We want to predict the weight of a car based on hp. Build your regression model.
#what is your regression equation? how much of the variance is explained by your model?
#check residuals and comment on the pattern of distribution.Is there any reason for concern?
#extract residuals and predicted values
#Does adding mpg as a predictor improve the model?
#which is the better model?
#add the interaction effect of mpg with hp to your model
#is the interaction effect significant?
#####################################
#Question 2
#read data txt
brains<-read.table(file="brains.txt",header=T)
#explore the data
#make box plots for the brain data using the boxplot function.
#comment on the box plot. Transform the data using log transformation and then plot again.
#comment on descriptive statistics
#compare scatter plot of transformed and non tranformed data
#change the points on the scatter plot from open circles to closed dots using pch=16
#is there a correlations between body and weight? Does it differ from transformed and non transformed data?
#fit a regresion model to transformed data
#is th model signficant?
#fit a line to the log transformed scatterplot
#some cases (dinosaurs) are outliers so run the model without them.
#is the model a better fit with these value excluded?
#####################################
#Question 3
#Use(mtcars)
data(mtcars)
#use mpg as DV and number of cylinders and gears as fixed effect
#Identify the design type
#explore descriptive statistics
#fit an ANOVA model with only fix effects
#fit an ANOVA model including interaction effects
#What factors are signficant? Is the interaction effect signficant?
#plot your interaction effect
hint use ?interaction.plot