Closed PattyTimmons closed 2 months ago
Hi @AntJam-Howell just touching base again on my questions for lab 6. I am hoping I can wrap up this assignment soon. Thank you
@PattyTimmons you may want to email him directly. Last time I hadn't heard from him he said he never received a notification he was tagged.
Hi @PattyTimmons,
thanks for re-pinging me.
Q1. Yes, for the y_hat, you need to calculate that, which can be done using the predict()
function applied to the happiness model.
Q2. You will want to have something like the following to create income squared:
income <- dat$income / 10000
income.sq <- income*income
m <- lm( happy ~ income + income.sq )
Q3. You want to replace the y ~ x with your own model of happiness (m), and then use stargazer function to render the model m results into table format.
@AntJam-Howell I am still confused about Q1 where exactly are we supposed to insert the predict() and how do we format it?
Hi, @AntJam-Howell I have a couple questions about this lab
It gives an error that y_hat cannot be found, do I need to calculate that?
I inserted the code outlined in the lab instructions, but the output is giving me -26.4. Am I misunderstanding something here?
replace with model coefficients
b0 <- 1 b1 <- 1 b2 <- 1
x <- 15 # use 15000 if you did not rescale above happy.15k <- b0 + b1x + b2x*x
x <- 25 # use 25000 if you did not rescale above happy.25k <- b0 + b1x + b2x*x
happy.25k - happy.15k # marginal effect of $10k increase at $15k starting salary