Dear Statalisters:
I have been using the -xtdpdml- user-written command by Richard Williams, Paul Allison, and Enrique Moral-Benito. I'm a big fan of it, but I've been having some trouble specifying the vce() option.
First, running a model with vce(robust) works fine. So if I have syntax that goes:
Everything works perfectly.
However, if I try to specify a cluster-robust standard error, like this, I get an error code:
If I try to bootstrap a cluster variable:
If I recall correctly, the code for the vce(bootstrap, cluster) option is different in the command than if you run it before. I also tried it like this, and I got a different error message:
In any case, if I reshape it to wide and run it with wide option, like this:
I get the same estimates for everything when it works, and it doesn't work in the same places as before. So that code is doing the same thing as when it's long.
I decided that the best option was just to convert everything using the showcmd option because I know how to specify the different standard error options with the -sem- command. However, a strange thing happened when I tried to replicate the findings using this:
This gives me slightly different estimates than when I used the "wide" option and basic syntax. It's not different enough for there to be any substantive differences, but it is enough that I noticed it. So while these are probably sensible settings, it does appear they are slightly different than the ones taken in the basic xtdpdml command.
For what it works, this code:
Works perfectly, except that it has the slightly different parameter estimates as before.
I think that there are two ways to solve this. One solution is to figure out why xtdpdml seems unable to handle cluster variables. The other possible solution is to figure out why the showcmd option gives what must be slightly different code than what xtdpdml is using.
Thanks for reading this. I'm stumped and would love to hear some input.
Best,
Jonathan
I have been using the -xtdpdml- user-written command by Richard Williams, Paul Allison, and Enrique Moral-Benito. I'm a big fan of it, but I've been having some trouble specifying the vce() option.
First, running a model with vce(robust) works fine. So if I have syntax that goes:
Code:
xtdpdml y, pre(x1 x2 x3) vce(robust)
However, if I try to specify a cluster-robust standard error, like this, I get an error code:
Code:
xtdpdml y, pre(x1 x2 x3) vce(cluster clvar) variable clvar not found
Code:
xtdpdml y, pre(x1 x2 x3) vce(bootstrap, cluster(clvar)) variable clvar not found (error in option cluster())
Code:
bootstrap, cluster(clvar): xtdpdml y, pre(x1 x2 x3) .........repeated time values within panel the most likely cause for this error is misspecifying the cluster(), idcluster(), or group() option
Code:
xtdpdml y, pre(x1 x2 x3) showcmd wide
I decided that the best option was just to convert everything using the showcmd option because I know how to specify the different standard error options with the -sem- command. However, a strange thing happened when I tried to replicate the findings using this:
Code:
sem (y2 <- y1@b1 x1_2@b2 x2_2@b3 /// x3_2@b4 Alpha@1 E2@1 ) (y3 <- y2@b1 /// x1_3@b2 x2_3@b3 x3_3@b4 Alpha@1 E3@1 ) (y4 <- /// y3@b1 x1_4@b2 x2_4@b3 x3_4@b4 Alpha@1 ), /// var(e.y2@0 e.y3@0) var(Alpha) /// cov(Alpha*(E2 E3)@0 _OEx*(E2 E3)@0 E2*(E3)@0 x1_3*(E2) /// x2_3*(E2) x3_3*(E2) x1_4*(E2 E3) x2_4*(E2 E3) /// x3_4*(E2 E3)) iterate(250) technique(nr 25 bhhh 25) noxconditional
For what it works, this code:
Code:
bootstrap, cluster(schoolname): sem (y2 <- y1@b1 x1_2@b2 x2_2@b3 /// x3_2@b4 Alpha@1 E2@1 ) (y3 <- y2@b1 /// x1_3@b2 x2_3@b3 x3_3@b4 Alpha@1 E3@1 ) (y4 <- /// y3@b1 x1_4@b2 x2_4@b3 x3_4@b4 Alpha@1 ), /// var(e.y2@0 e.y3@0) var(Alpha) /// cov(Alpha*(E2 E3)@0 _OEx*(E2 E3)@0 E2*(E3)@0 x1_3*(E2) /// x2_3*(E2) x3_3*(E2) x1_4*(E2 E3) x2_4*(E2 E3) /// x3_4*(E2 E3)) iterate(250) technique(nr 25 bhhh 25) noxconditional
I think that there are two ways to solve this. One solution is to figure out why xtdpdml seems unable to handle cluster variables. The other possible solution is to figure out why the showcmd option gives what must be slightly different code than what xtdpdml is using.
Thanks for reading this. I'm stumped and would love to hear some input.
Best,
Jonathan
Comment