Multiple Linear Regression

 

 

Use the dataset that you have been using for the previous projects. Use all of your independent variables, your response variable, and the lm() function to build a multiple linear regression model. Print the model with the summary() function. The output will be similar to the bottom of page 141.

Use the pairs() function to look at the scatterplots of the interval/ratio variables. Color your points by the value of a nominal/ordinal variable.

A standard regression model with correlated independent variables will almost always perform poorly. For this project, you will remove independent variables until the model is trustworthy. Use the summary() output

The scatterplots to decide if a variable should be removed. Remove the variable.

Repeat the process of
• build model
• check summary() and scatterplots
• remove variable until you believe all variables in the model should stay in the model.
Use par(mfrow = c(2,2)) and the plot() function to look at diagnostic plots of the reduced model (similar to the plots on page 129).

Create a simple linear regression model with one of your numeric independent variable and your response variable.

Build the scatterplot of the response variable by the independent variable, Include the line of best fit on the first scatterplot.

The scatterplot of the residuals by the independent variable (similar to figure 3.3, page 50).

Plot the residuals by the response variable. Do you the scatterplots indicate that there are any problems with the model?

Use hist() to plot a histogram of the residuals. Do the residuals appear to be normally distributed?

Use qqnorm() and qqline() to plot a QQ-normal plot with the QQ-line of the residuals. Do the residuals appear to be normally distributed?
Use par(mfrow = c(2,2)) and plot(‘linear model’) to build a plot similar to figure 3.14 on page 70.

Record which data points are labeled in the subplots.
Solution:
The data points: 209, 425, 435, and 599.
Print those observations. Investigate each of these points and decide which ones are legitimate data points and which ones are erroneous and polluting your dataset. Use car::powerTransform() to find power transformations for
• y – min(y) + 1, and
• x – min(x) + 1.
Transform the data and call the new data y_new and x_new. Build four scatterplots.
• y ~ x
• y_new ~ x
• y ~ x_new
• y_new ~ x_new
Which of these models appears to be the be fit?
Solution:
The simple linear regression model.

Build the corresponding linear model.

 

 

 

 

 

 

Sample Solution

Plato argues that there is a difference between sense-perception and knowledge. Many of us assume that we know the world through our eyes. All we have to do is open our eyes and whatever is in front of us is real. When learning philosophy, the study of knowledge is called epistemology. Plato a well-known philosopher famously defined knowledge as “justified true belief”. Plato postulated that a reality outside of what a common human experiences exists. He goes to prove his theory by comparing human experiences through their senses to those of the caveman looking at shadow play on the cave walls. The cavemen have never really experienced anything but they are forced to believe that there is a reality thanks to those shadows.
Plato claims that there is a reality outside of that. For instance, when talking about cavemen, there is something or someone outside the cave that helps project those shadows. There is always a source of light for example the sun which proved the light, a whole world exists outside of the cave but since the caveman is focused on the shadows they don’t even notice that. To the caveman the shadows are a reality so anything that isn’t a shadow isn’t real. Plato argues that it doesn’t matter how accurately our senses can detect the shadows the argument is that there is a reality outside of what our senses can perceive. The original philosophy argument, from Plato 2500 years ago, didn’t doubt sense impressions as such: The cave analogy assumes that the sense impressions of the caveman accurately reflected the shadow play on the cave wall. Many philosophers including Plato argue that there is an entire world outside of what a normal human perceives. In simple words, the answer to the question is that you could always be missing something.

This question has been answered.

Get Answer