Open jmacost5 opened 2 years ago
@jmacost5 try this p.vacant.75 <- quantile(p.vacant, p=0.75,na.rm=TRUE )
Looks like you have missing data, try to remove those missing data.
@JasonSills @u12345
For this part of the lab, using the example code provided (below), what position of x is it referring to? Position relative to what? Do I need to update this number based on what model number I am looking at?
m <- lm( y ~ x )
x.75 <- quantile( x, p=0.75 )
x.25 <- quantile( x, p=0.25 )
beta.x <- m$coefficients[2] # position of x in the model
effect.size.x <- ( x.75 - x.25 ) * beta.x
For example, I have 4 total models; one naive model for each of my variables, and then a full model with all three combined:
m1 <- lm( mhv.growth ~ p.col, data=reg.data )
m2 <- lm( mhv.growth ~ p.prof, data=reg.data )
m3 <- lm( mhv.growth ~ hinc00, data=reg.data )
m4 <- lm( mhv.growth ~ p.col + p.prof + hinc00, data=reg.data )
If I am trying to determine the effect size of percent college educated (p.col) should I use m1 or m4? What position number should I use?
@droach7 "For this part of the lab, using the example code provided (below), what position of x is it referring to? Position relative to what?"
It is the position of the coefficient in the model. In the bivariate the position is 2, since you have the intercept. The number will change in a multivariate model. If you have multiple coefficients you will change the number you are plugging in.
"If I am trying to determine the effect size of percent college educated (p.col) should I use m1 or m4?" You would choose the model you are using. These are different models with different effect sizes. For this exercise you are asked to create a model with 3 variables. This is the one you will you to calculate effect size.
I am having issue on part 6 for my code, I keep getting error's