Watts-College / cpp-525-spr-2022

https://watts-college.github.io/cpp-525-spr-2022/
0 stars 0 forks source link

With Intercept vs Without (Q2 +3) #9

Open kaseympotts opened 2 years ago

kaseympotts commented 2 years ago

When I run the table for Q2, I only get all the state values in the column for the model with an intercept.

Should they be in the other column, too? The later questions for Q3 make me question the initial output.

JPRayes commented 2 years ago

I'm in the same boat... the coding for this lab is pretty difficult

jmacost5 commented 2 years ago

did you ever find the issue out? my code is not working either.

Dselby86 commented 2 years ago

The lecture tells you to use the plm package. You can also do lm(y ~x -1). Including -1 in a linear model formula tells r to not report the intercept.

On Sat, Apr 9, 2022, 6:51 AM Jestrii Acosta @.***> wrote:

did you ever find the issue out? my code is not working either.

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-525-spr-2022/issues/9#issuecomment-1094036113, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHB3O3LOQWNIBTAJG233VEGDOBANCNFSM5SNS55OA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jmacost5 commented 2 years ago

I figured it out... it had to do with the variables i was using not being correct and forgetting to add the one. I guess my next question is what model am I missing in this question it says " for Q2c Now run two fixed-effect models, one including the intercept and one excluding the intercept (you can use the plm function for this latter). Present the results in a nice table.". Then the question " Q3c; What is the value of the coefficient of “State4” in the second model? What does it say about the number of car accidents in state 4?" I have the fixed regression and the plm, am I missing another regression?

Dselby86 commented 2 years ago

The first model is the one with the I tercept the second model is the one without

On Sat, Apr 9, 2022, 7:37 AM Jestrii Acosta @.***> wrote:

I figured it out... it had to do with the variables i was using not being correct and forgetting to add the one. I guess my next question is what model am I missing in this question it says " for Q2c Now run two fixed-effect models, one including the intercept and one excluding the intercept (you can use the plm function for this latter). Present the results in a nice table.". Then the question " Q3c; What is the value of the coefficient of “State4” in the second model? What does it say about the number of car accidents in state 4?" I have the fixed regression and the plm, am I missing another regression?

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-525-spr-2022/issues/9#issuecomment-1094048392, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHB3EQFTXI3YPFDMJF23VEGIY3ANCNFSM5SNS55OA . You are receiving this because you commented.Message ID: @.***>

jmacost5 commented 2 years ago

Do I include the other variables on that model too then because I don’t see the other variables.

Dselby86 commented 1 year ago

If you used the plm function then you can extract the variables using the coeffic() function. You pass your model to the function and it will give you the values of your fixed effects. You don't need it for the stargazer tablee but do need those values for later questions

On Sat, Apr 9, 2022, 10:13 AM Jestrii Acosta @.***> wrote:

Do I include the other variables on that model too then because I don’t see the other variables.

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-525-spr-2022/issues/9#issuecomment-1094087818, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHBZCEP4I24RLD4BFOBLVEG3ERANCNFSM5SNS55OA . You are receiving this because you commented.Message ID: @.***>