Hi all,
I am trying to compute a variance equality test with weighted data. I found this very helpful on Stack Exchange:
https://stats.stackexchange.com/ques...ed-survey-data
In which Stas Kolenikov suggests the following code :
However, when I run this (and hundreds of variations thereof) I get an error saying equation bpsystol_sq not found.
The coefficients are indeed stored..
But, attempting to reference them by location gives the following:
As does various other variations on that theme. I'd be very grateful for any advice.
Cheers,
Stu.
I am trying to compute a variance equality test with weighted data. I found this very helpful on Stack Exchange:
https://stats.stackexchange.com/ques...ed-survey-data
In which Stas Kolenikov suggests the following code :
Code:
webuse nhanes2, clear gen bpsystol_sq = bpsystol* bpsystol svy : mean bpsystol*, over( female ) * estimated variance in group 0 nlcom ( _b[bpsystol_sq:0] - _b[bpsystol:0]*_b[bpsystol:0]) * estimated variance in group 1 nlcom ( _b[bpsystol_sq:1] - _b[bpsystol:1]*_b[bpsystol:1]) * equality test testnl ( _b[bpsystol_sq:1] - _b[bpsystol:1]*_b[bpsystol:1]) /// = ( _b[bpsystol_sq:0] - _b[bpsystol:0]*_b[bpsystol:0])
The coefficients are indeed stored..
Code:
matrix list e(b) e(b)[1,4] c.bpsystol@ c.bpsystol@ c.bpsystol~q@ c.bpsystol~q@ 0.female 1.female 0.female 1.female y1 129.92525 124.20266 17255.068 15945.381
Code:
testnl (e(b)[1,4] - e(b)[1,2]*e(b)[1,2]) = ( e(b)[1,3] - e(b)[1,1]*e(b)[1,1]) invalid '2'
Cheers,
Stu.
Comment