Hi all,
I am new in this forum so if this is not the proper place to post this question let me know please.
I have to run some wald test after the margin commands. I have 10 different outcomes and I have to run 8 tests for each one of them. I am using a forevalues loop to run the tests in each outcome and it does work. The code is this:
ologit INCDECIL HWUSUAL gender sup exp NatISCED* EUcitISCED* nonEUcitISCED* EUresid nonEUcitresid
margins, predict (outcome(1)) dydx(NatISCED* EUcitISCED*) at(EUresid = 0 nonEUcitresid = 0 EUcitISCED1 = 0 EUcitISCED2 = 0 EUcitISCED3 = 0 EUcitISCED4 = 0 EUcitISCED5 = 0 EUcitISCED6 = 0 EUcitISCED7 = 0 EUcitISCED8 = 0 nonEUcitISCED1 = 0 nonEUcitISCED2 = 0 nonEUcitISCED3 = 0 nonEUcitISCED4 = 0 nonEUcitISCED5 = 0 nonEUcitISCED6 = 0 nonEUcitISCED7 = 0 nonEUcitISCED8 = 0) ///
post at(nonEUcitresid = 0 NatISCED1 = 0 NatISCED2 = 0 NatISCED3 = 0 NatISCED4 = 0 NatISCED5 = 0 NatISCED6 = 0 NatISCED7 = 0 NatISCED8 = 0 nonEUcitISCED1 = 0 nonEUcitISCED2 = 0 nonEUcitISCED3 = 0 nonEUcitISCED4 = 0 nonEUcitISCED5 = 0 nonEUcitISCED6 = 0 nonEUcitISCED7 = 0 nonEUcitISCED8 = 0)
forvalues i = 1/8 {
test [NatISCED`i']1._at - [EUcitISCED`i']2._at = 0
local sign_ag = sign([NatISCED`i']1._at - [EUcitISCED`i']2._at)
display "H_0: NatISCED`i' coef <= EUcitISCED`i' coef. p-value = " 1-normal(`sign_ag'*sqrt(r(chi2)))
}
I would like to include the input for margins into the loop so I can run it for outcome from 1 to 10 and inside each outcome run the test as it is specified in the forvalues loop. I would like to save on running the margin command ten times and afterword running my loop. Can I use several loops to do that? Any advise on how to do it.
Thank you in advance,
Carlos.
Related Posts with Using several loops together
Bootstrap of eigenvalues of MCA.Hi, I am a new user of this forum. My question is about how to perform a bootstrap of eigenvalues of…
*ppml trade: "Warning: *variance matrix is nonsymmetric or highly singular"Hi, I am trying to estimate this gravity equation: ppml trade PAIR_FE1-PAIR_FE$NTij_1 EXPORTER_TIM…
Recoding variables >0 and <0Hi there, I'm looking into school standards and want to analyse schools which oversubscribed and un…
Using Driscoll and Kraay Standard Errors when T is smallDear all, It is my first post here. I have a panel data (N= 277 firms, T= 3 years). I used the Haus…
Partially transpose/ reshape variable in datasetHello there, I have a data set like this- uid question c1 c2 c3 1 q1 2 3 6 1 q2 3 5 2 1 q3 4 5 3 …
Subscribe to:
Post Comments (Atom)
0 Response to Using several loops together
Post a Comment