Watts-College / cpp-525-spr-2022

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

Regression Discontinuity Q1b #12

Open JPRayes opened 2 years ago

JPRayes commented 2 years ago

I'm trying to run a regression model to determine statistical significance between the treatment and control group. However, when I run the model, I only see outputs for "Treatment" and "Constant" but not "Attendance":


data$attendance <- data$treatment==1

reg <- lm( data$gpa_9 ~ data$treatment + data$attendance, data = data )

stargazer( reg, 
           type = "text", 
           dep.var.labels = ("Grade 9 GPA"),
           column.labels = c(""),
           covariate.labels = c("Treatment", "Attendance"),
           omit.stat = "all", 
           digits = 2 )

This is the what I see when I run the chunk

image

What am I missing here? Thanks.

Dselby86 commented 2 years ago

If you hame lm( Data =data) then in your model you don't need data$variable

So reg <- lm(gpa_9~treatment + attendance, data = data) should work.

Then use summary(reg) That will show you the model results before the stargazer table.

On Fri, Apr 22, 2022, 5:34 AM JPRayes @.***> wrote:

I'm trying to run a regression model to determine statistical significance between the treatment and control group. However, when I run the model, I only see outputs for "Treatment" and "Constant" but not "Attendance":

data$attendance <- data$treatment==1

reg <- lm( data$gpa_9 ~ data$treatment + data$attendance, data = data )

stargazer( reg, type = "text", dep.var.labels = ("Grade 9 GPA"), column.labels = c(""), covariate.labels = c("Treatment", "Attendance"), omit.stat = "all", digits = 2 )

This is the what I see when I run the chunk

[image: image] https://user-images.githubusercontent.com/89749758/164715001-cf702b74-6787-45e0-9431-2369af64239c.png

What am I missing here? Thanks.

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