Hi there , I'm practicing propensity scores and propensity score matching.
with regards to data:
I used this data:
webuse cattaneo2
Research question:
Does alochol effect birth weight in kids?
Matching on: maternal age, maternal education, maternal smoking.
Problem is with propensity score matching code -
A. why does it give me the error below?
psmatch2 $treatment $xlist , outcome($ylist) pscore(myscore) neighbor(5) common bw(0.06)
You cannot specify both a varlist AND a propensity score
r(198);
If pscore(x) - x = varname containing propensity scores why is stata giving me the error above
B. Why does attnd work and this is not the recommended way on stata?
TO GIVE YOU A BACKGROUN THIS IS THE CODE I USED;
___
**Creating macros
global treatment alcohol //intervention/treatment
global ylist bweight //outcome
global xlist mage medu msmoke //variables to match on t
*Creating a regression with the dummy variable for treatment (intervention which has to be 1 or 0)
reg $ylist $treatment
//y vairable (outcome variable) followed by treatment
*Creating a regression but now controlling for cofounding
reg $ylist $treatment $xlist
//Estimate propensity scores
pscore $treatment $xlist,pscore(myscore)blockid(myblock)comsup
probit regression
*****MATCHING *****
Now I looked for stata help which says that neighbour hood matching should have this format
With this example:
psmatch2 depvar [indepvars] [if exp] [in range] , [outcome(varlist) pscore(varname) neighbor(integer k>1)
caliper(real) common trim(real) odds index logit ties warnings quietly ate]
Stata given this example: psmatch2 training age gender, n(5) logit
NOW i tried:
psmatch2 $treatment $xlist , outcome($ylist) pscore(myscore) neighbor(5) common bw(0.06)
eRROR given
You cannot specify both a varlist AND a propensity score
r(198);
$treatment - Alcohol
$xlist - variables to match on
$ylist - b weight - outcome
myscore - already calculated propensity scores.
Why does it give me the above error?
Also:
I have also used:
attnd $ylist $treatment $xlist, pscore(myscore)
This also gave me my propenisty scores between 0.1253 - 0.209.
Questions:
1. Why do I get the above error using the technique recommended by stata
2. Why does attnd work and this is not the recommended way on stata?
with regards to data:
I used this data:
webuse cattaneo2
Research question:
Does alochol effect birth weight in kids?
Matching on: maternal age, maternal education, maternal smoking.
Problem is with propensity score matching code -
A. why does it give me the error below?
psmatch2 $treatment $xlist , outcome($ylist) pscore(myscore) neighbor(5) common bw(0.06)
You cannot specify both a varlist AND a propensity score
r(198);
If pscore(x) - x = varname containing propensity scores why is stata giving me the error above
B. Why does attnd work and this is not the recommended way on stata?
TO GIVE YOU A BACKGROUN THIS IS THE CODE I USED;
___
**Creating macros
global treatment alcohol //intervention/treatment
global ylist bweight //outcome
global xlist mage medu msmoke //variables to match on t
*Creating a regression with the dummy variable for treatment (intervention which has to be 1 or 0)
reg $ylist $treatment
//y vairable (outcome variable) followed by treatment
*Creating a regression but now controlling for cofounding
reg $ylist $treatment $xlist
//Estimate propensity scores
pscore $treatment $xlist,pscore(myscore)blockid(myblock)comsup
probit regression
*****MATCHING *****
Now I looked for stata help which says that neighbour hood matching should have this format
With this example:
psmatch2 depvar [indepvars] [if exp] [in range] , [outcome(varlist) pscore(varname) neighbor(integer k>1)
caliper(real) common trim(real) odds index logit ties warnings quietly ate]
Stata given this example: psmatch2 training age gender, n(5) logit
NOW i tried:
psmatch2 $treatment $xlist , outcome($ylist) pscore(myscore) neighbor(5) common bw(0.06)
eRROR given
You cannot specify both a varlist AND a propensity score
r(198);
$treatment - Alcohol
$xlist - variables to match on
$ylist - b weight - outcome
myscore - already calculated propensity scores.
Why does it give me the above error?
Also:
I have also used:
attnd $ylist $treatment $xlist, pscore(myscore)
This also gave me my propenisty scores between 0.1253 - 0.209.
Questions:
1. Why do I get the above error using the technique recommended by stata
2. Why does attnd work and this is not the recommended way on stata?
Comment