Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • pweights not allowed , please help me

    hello, I am using the xtscc and I want to estimate the ATE following the jorda`s paper. I have a panel data from 1996-2019 but when I estimate the model I get the error that "pweight is not allowed" , I try to find the logic behind this because when I do through the simple regression I can use the "pweight" but in the "xtscc" no.

    Code:
    gen a=forward_dumrecession
    
    gen invwt=a/probit_hat + (1-a)/(1-probit_hat)
    Code:
    capture drop a invwt 
    foreach v in  ltotalfertility          {
    foreach vart in "0" "1" "2" "3" "4" "5"{
        * SAME OUTCOME REG IN BOTH T&C THIS TIME, REST ALL THE SAME (eq18)
       xi: xtscc d`vart'`v' l(0/2) l(0/2)forward_dumrecession l(1/1)d0`v'  i.year [pweight=invwt],fe  
        *set sample
        gen samp=e(sample) 
        *actual
        predict mu0 if samp==1 & forward_dumrecession==0 
        *actual
        predict mu1 if samp==1 & forward_dumrecession==1 
        * ghost
        replace mu0 = mu1 - _b[forward_dumrecession] if samp==1 & forward_dumrecession==1 
        * ghost
        replace mu1 = mu0 + _b[forward_dumrecession] if samp==1 & forward_dumrecession==0 
        *from Lunt et al
        generate mdiff1=(-(a-probit_hat)*mu1/probit_hat)-((a-probit_hat)*mu0/(1-probit_hat))
        generate iptw=(2*a-1)*d`vart'`v'*invwt
        generate dr1=iptw+mdiff1
        *constant for convenience in next reg to get mean
        qui gen ATE_IPWRA=1 
        qui reg dr1 ATE_IPWRA , nocons 
        eststo DR1_d`vart'`v'
        sum dr1
        local dr1m = r(mean)
        gen Isq  = (dr1-`dr1m')^2
        sum Isq
        estadd scalar RobustSE = sqrt(r(mean)/r(N))
        estadd scalar pvalue = normal(`dr1m'/sqrt(r(mean)/r(N)))    
        capture drop iptw Isq mdiff1 dr1 mu1 mu0 samp ATE_IPWRA
        capture scalar drop dr1m
        }
        }



    I hope I receive your assistance.

    regards,
Working...
X