Skip to content

Commit

Permalink
h
Browse files Browse the repository at this point in the history
h
  • Loading branch information
friosavila committed Dec 28, 2023
1 parent c687884 commit 6819e5d
Showing 1 changed file with 9 additions and 32 deletions.
41 changes: 9 additions & 32 deletions jwdid/jwdid2.ado
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* Add to estat event, an option for Any ATTGT
* This means, a way to do simple, for post and pre..algo como el cevent. But based on Everything
* This version aims to incorporate features for Gravity
*!v1.41 Allows for multiple Options
*!v1.42 Tocluster change for cases when cluster(xxx) is not accepted
*v1.41 Allows for multiple Options
* Also FV and TS
* v1.4 Allows for TRT to be continuous, and adds example
* v1.36 Adds TrtVar or Gvar
Expand Down Expand Up @@ -35,7 +36,9 @@ end

program method_parser, rclass
syntax namelist , [*]
local method1:word 1 of `namelist'
return local method `namelist'
return local method1 `method1'
return local options `options'
end

Expand Down Expand Up @@ -79,6 +82,7 @@ program jwdid2, eclass
if "`method'"!="" {
method_parser `method'
local method `r(method)'
local method1 `r(method1)'
local method_option `r(options)'
}

Expand Down Expand Up @@ -219,17 +223,16 @@ program jwdid2, eclass
** Cluster level
if "`cluster'"=="" & "`ivar'"=="" local cvar
if "`cluster'"=="" & "`ivar'"!="" local cvar `ivar'
if "`cluster'"!="" local cvar `cluster'

if "`method1'"=="fracreg" local tocluster vce(cluster `cvar')
else tocluster cluster(`cvar')

if "`method'"=="" {
if "`group'"=="" {

<<<<<<< Updated upstream
reghdfe `y' `xvar' `otxvar' `xnovar' ///
if `touse' [`weight'`exp'], abs(`ivar' `tvar' `fevar') cluster(`cvar') keepsingletons
=======
reghdfe `y' `xvar' `otxvar' `exogvar' ///
if `touse' [`weight'`exp'], abs(`ivar' `tvar' `fevar') `tocluster' keepsingletons
>>>>>>> Stashed changes
}
else {
if "`ivar'"!="" {
Expand All @@ -242,23 +245,13 @@ program jwdid2, eclass
local xcorr `r(vlist)'
}
}
<<<<<<< Updated upstream
reghdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `xnovar' ///
if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') cluster(`cvar') keepsingletons noempty
}
}
else if "`method'"=="ppmlhdfe" {
ppmlhdfe `y' `xvar' `otxvar' `xnovar' ///
if `touse' [`weight'`exp'], abs(`ivar' `tvar' `fevar') cluster(`cvar') keepsingletons ///
=======
reghdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `exogvar' ///
if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') `tocluster' keepsingletons noempty
}
}
else if "`method'"=="ppmlhdfe" {
ppmlhdfe `y' `xvar' `otxvar' `exogvar' ///
if `touse' [`weight'`exp'], abs(`ivar' `tvar' `fevar') `tocluster' keepsingletons ///
>>>>>>> Stashed changes
d `method_option'
}
else {
Expand All @@ -271,39 +264,23 @@ program jwdid2, eclass
local xcorr `r(vlist)'
}
}
<<<<<<< Updated upstream
`method' `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `xnovar' i.`gvar' i.`tvar' ///
if `touse' [`weight'`exp'], cluster(`cvar') `method_option'
=======
`method' `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `exogvar' i.`gvar' i.`tvar' ///
if `touse' [`weight'`exp'], `tocluster' `method_option'
>>>>>>> Stashed changes
}

ereturn local cmd jwdid
ereturn local cmd2 `method'
ereturn local cmdopt `method_option'

ereturn local cmdline jwdid `0'
<<<<<<< Updated upstream
if "`method'"!="" & "`method'"!="ppmlhdfe" {
ereturn local scmd `method' `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `xnovar' i.`gvar' i.`tvar' if `touse' [`weight'`exp'], cluster(`cvar')
}
else if "`method'"=="ppmlhdfe" {
ereturn local scmd ppmlhdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `xnovar' if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') cluster(`cvar') keepsingletons noempty
}
else {
ereturn local scmd reghdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `xnovar' if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') cluster(`cvar') keepsingletons noempty
=======
if "`method'"!="" & `method'!="ppmlhdfe" {
ereturn local scmd `method' `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `exogvar' i.`gvar' i.`tvar' if `touse' [`weight'`exp'], `tocluster'
}
else if "`method'"=="ppmlhdfe" {
ereturn local scmd ppmlhdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `exogvar' if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') `tocluster' keepsingletons noempty
}
else {
ereturn local scmd reghdfe `y' `xvar' `x' `ogxvar' `otxvar' `xcorr' `exogvar' if `touse' [`weight'`exp'], abs(`gvar' `tvar' `fevar') `tocluster' keepsingletons noempty
>>>>>>> Stashed changes
}
ereturn local estat_cmd jwdid_estat
if "`never'"!="" ereturn local type never
Expand Down

0 comments on commit 6819e5d

Please sign in to comment.