Announcement

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

  • invalid syntax error

    Hi,

    There is some sort of issue here with "sum `var' if (poolednormscore2> -$bw2lvp & poolednormscore2 < 0 ) & allbw==1" this line. If I take it out, it runs. I have tried a bunch of things but I am just not sure what is going on. Allbw is a var that =0 or =1 depending on if I want you in this sample.


    Code:
    eststo clear
    
        foreach var in Black male inv_p6m service_p6m removed_p6m dw_housing_p6 dw_medicaid_p6 dw_outpatientp6 dw_crt_fam_dep_p6 anycrtp6 dw_drug_alc_p6 dw_benefits_p6 dw_jail_p6 selfhea_p6 injaut_p6 nutrit_p6 injnoaut_p6 schnitzer_p6 prevent_p6 wellness_p6 immune_p6 posion_p6 {
            
            
            rdrobust `var' poolednormscore2 if allbw==1,c(0) h($bw2lvp $bw2rvp ) vce(cluster refer_id) 
            estadd scalar leftbw= e(N_h_l) 
            estadd scalar rightbw= e(N_h_r) 
            sum `var'  if (poolednormscore2> -$bw2lvp & poolednormscore2 < 0 ) & allbw==1
            estadd scalar ymean = r(mean)
            eststo mal`i'1619p2f
        }
        
            foreach var in Black male inv_p6m service_p6m removed_p6m dw_housingp6 dw_medicaid p6 dw_outpatientp6 dw_crt_fam_dep_p6 anycrtp6 dw_drug_alc_p6 dw_benefits_p6 dw_jail_p6 selfhea_p6 injaut_p6 nutrit_p6 injnoaut_p6 schnitzer_p6 prevent_p6 wellness_p6 immune_p6 posion_p6 {
            
            
            rdrobust `var' poolednormscore2 if White==1,c(0) h($bw2lvp $bw2rvp ) vce(cluster refer_id) 
            estadd scalar leftbw= e(N_h_l) 
            estadd scalar rightbw= e(N_h_r) 
            sum `var'  if (poolednormscore2> -$bw2lvp & poolednormscore2 < 0 ) & White==1
            estadd scalar ymean = r(mean)
            eststo mwh`i'1619p2f
        }
        
        foreach var in Black male inv_p6m service_p6m removed_p6m dw_housingp6 dw_medicaid p6 dw_outpatientp6 dw_crt_fam_dep_p6 anycrtp6 dw_drug_alc_p6 dw_benefits_p6 dw_jail_p6 selfhea_p6 injaut_p6 nutrit_p6 injnoaut_p6 schnitzer_p6 prevent_p6 wellness_p6 immune_p6 posion_p6 {
            
            
            rdrobust `var' poolednormscore2 if Black==1,c(0) h($bw2lvp $bw2rvp ) vce(cluster refer_id) 
            estadd scalar leftbw= e(N_h_l) 
            estadd scalar rightbw= e(N_h_r) 
            sum `var'  if (poolednormscore2> -$bw2lvp & poolednormscore2 < 0 ) & Black==1
            estadd scalar ymean = r(mean)
            eststo mbl`i'1619p2f
        }
    
        esttab *1619p2f using "Panelquad`count'f.tex", style(tex) replace stats(ymean rightbw leftbw,labels("Mean" "RightBW" "LeftBW")) label se star(* 0.1 ** 0.05 *** 0.01) mtitles("Black" "Male" "Investigation" "Accepted" "Removed" "Housing" "Medicaid" "Outpatient" "Dependent crt" "any charge" ) coeflabels(RD_Estimate "Estimate")
    
        
        local ++count
    
        }

  • #2
    We need to see what's inside the global bw21vp to comment.

    Code:
    di "$bw21vp"

    Comment


    • #3
      Well, thank you! That is the issue--I thought this was defined but it was not, lol. That fixed it

      Comment

      Working...
      X