Question: How do I construct a table showing the number of matches to assess covariate balance I.e no of matched treatments to number of controls?
Unfortunately, this is neither part of the psmatch2 or pstest output. Therefore one has
to construct the tables themselves.
David Radwin Melissa Garrido Oyvind Snilsberg
//Research question: Does alcohol affect bweight
**Creating macros
global treatment alcohol //intervention/treatment
global ylist bweight //outcome
global xlist mage medu msmoke //variables to match on t
//Ensuring replication
//Set seed to replicate the results
set seed 1234
gen sort_id = uniform()
sort sort_id
//Calculate psscore using psmatch2
psmatch2 $treatment $xlist, outcome($ylist) neighbor(3) bw (0.06) common logit
//Drawing graphs
pstest $xlist, treated($treatment) both
This is where I would appreciate your help
//Creating tables to show matched treatments to controls
//Drop the missing _weight values. If matched _weight = >0
drop if _weight == .
//Trying to summarize the number of matched treatment and controls
tabstat $treatment=1 [aw=_weight], by($xlist)
This returns an error with too many weights.
I understand that if _weight > 0 this is equal to a control that has been matched
_______
Also, what are your thoughts on Stephen Porter's website who quotes someone else that psmatch2 shouldn't be used. What are your thoughts about this? As I was rather happy with psmatch2
https://stephenporter.org/understand...atas-psmatch2/
Unfortunately, this is neither part of the psmatch2 or pstest output. Therefore one has
to construct the tables themselves.
David Radwin Melissa Garrido Oyvind Snilsberg
- May I confirm this is correct? I have come up with the following code (using dummy data)
//Research question: Does alcohol affect bweight
**Creating macros
global treatment alcohol //intervention/treatment
global ylist bweight //outcome
global xlist mage medu msmoke //variables to match on t
//Ensuring replication
//Set seed to replicate the results
set seed 1234
gen sort_id = uniform()
sort sort_id
//Calculate psscore using psmatch2
psmatch2 $treatment $xlist, outcome($ylist) neighbor(3) bw (0.06) common logit
//Drawing graphs
pstest $xlist, treated($treatment) both
This is where I would appreciate your help
//Creating tables to show matched treatments to controls
//Drop the missing _weight values. If matched _weight = >0
drop if _weight == .
//Trying to summarize the number of matched treatment and controls
tabstat $treatment=1 [aw=_weight], by($xlist)
This returns an error with too many weights.
I understand that if _weight > 0 this is equal to a control that has been matched
_______
Also, what are your thoughts on Stephen Porter's website who quotes someone else that psmatch2 shouldn't be used. What are your thoughts about this? As I was rather happy with psmatch2
https://stephenporter.org/understand...atas-psmatch2/
Comment