xuyiqing / fect

fixed effect counterfactual estimators
Other
53 stars 20 forks source link

Error in fect when specifying group #9

Closed danrthomas closed 1 year ago

danrthomas commented 3 years ago

Thank you for this great package.

When specifying a group to get group atts in fect, I get the error "object 'pvalue.group.att' not found". I think this is because in boot.R the section ` ## group effect

    if (!is.null(group)) {

        se.group.att <- apply(group.att.boot, 1, function(vec) sd(vec, na.rm=TRUE))

        CI.group.att <- cbind(c(out$group.att) - se.group.att * qnorm(1-alpha/2), 
                            c(out$group.att) + se.group.att * qnorm(1-alpha/2))

        pvalue.placebo <- (1-pnorm(abs(out$group.att/se.group.att)))*2

        est.group.att <- cbind(out$group.att, se.group.att, CI.group.att, pvalue.group.att)

        colnames(est.group.att) <- c("ATT", "S.E.", "CI.lower", "CI.upper", "p.value")
     }
}`

creates pvalue.placebo instead of pvalue.group.att.

xuyiqing commented 3 years ago

Thanks. We'll look into this.

On Thu, Dec 17, 2020 at 11:07 AM danrthomas notifications@github.com wrote:

Thank you for this great package.

When specifying a group to get group atts in fect, I get the error "object 'pvalue.group.att' not found". I think this is because in boot.R the section ` ## group effect

if (!is.null(group)) {

    se.group.att <- apply(group.att.boot, 1, function(vec) sd(vec, na.rm=TRUE))

    CI.group.att <- cbind(c(out$group.att) - se.group.att * qnorm(1-alpha/2),
                        c(out$group.att) + se.group.att * qnorm(1-alpha/2))

    pvalue.placebo <- (1-pnorm(abs(out$group.att/se.group.att)))*2

    est.group.att <- cbind(out$group.att, se.group.att, CI.group.att, pvalue.group.att)

    colnames(est.group.att) <- c("ATT", "S.E.", "CI.lower", "CI.upper", "p.value")
 }

}`

creates pvalue.placebo instead of pvalue.group.att.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xuyiqing/fect/issues/9, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB2PKGENMLCGRTQ5TCDS2ODSVJJHBANCNFSM4VADH3PQ .

-- Yiqing Xu

Assistant Professor Department of Political Science Stanford University http://yiqingxu.org/