Purchase Solution

R programming - Multiple Linear Regression

Not what you're looking for?

Ask Custom Question

Plots should be done in R, and data set is loaded through R. Please see attachment.

Attachments
Purchase this Solution

Solution Summary

R programming - Multiple Linear Regression

Solution Preview

Question 1

>dat <- read.csv("http://biostat.jhsph.edu/~iruczins/teaching/140.615/data/fev.csv",row.names=1)
>plot(dat)

This will give you 16 boxes, of which 12 has plots. These are all of the plots of 2 of the 4 variables. For example, the first row third column box is a plot of fev (y-axis, which horizontally aligns with the box) vs. height (x-axis, which is verticalled aligned with the box).

It is important to look at these before we begin, because they will give us a qualitative feeling of the data. For example, we can see that gender and smoke are dummy variables, and fev and height are variables that take all values in the positive reals. Furthermore, we can see that fev and height seems to be positively correlation (which is true intuitively).

We fit the following model. fev = beta0 + beta1*gender + beta2*height + beta3*smoking

> model1 = lm(fev~gender+height+smoking,data=dat)
> summary(model1)

Call:
lm(formula = fev ~ gender + height + smoking, data = dat)

Residuals:
Min 1Q Median 3Q Max
-1.82118 -0.30188 0.00575 0.30685 1.44124

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.244425 0.312132 -16.802 < 2e-16 ***
genderM 0.006640 0.034809 0.191 0.84875
height ...

Purchase this Solution


Free BrainMass Quizzes
Measures of Central Tendency

This quiz evaluates the students understanding of the measures of central tendency seen in statistics. This quiz is specifically designed to incorporate the measures of central tendency as they relate to psychological research.

Terms and Definitions for Statistics

This quiz covers basic terms and definitions of statistics.

Measures of Central Tendency

Tests knowledge of the three main measures of central tendency, including some simple calculation questions.

Know Your Statistical Concepts

Each question is a choice-summary multiple choice question that presents you with a statistical concept and then 4 numbered statements. You must decide which (if any) of the numbered statements is/are true as they relate to the statistical concept.