I have a regression model using discrete time hazard regression. And I wanted to study the effect of modifier A (binary) and factor B(linear spline with 5 knots, represents by “B?" in below), and the interaction between A and B (represents by "B?int?" below) to the outcome y. There was 3 follow-up timepoints, so fu1, fu2, fu3 were used in the discrete time model.
Therefore, the regression writes: cloglog y i.A B? B?int? fu1 fu2 fu3, nocon eform
Then I want to calculate the estimates for 100 points, and use these estimates to draw a graph. And my question is highlighted in red below: I wonder to represent the coefficients for fu1, fu2, fu3 in mata structure, should I use m0? To simply my question, how to represent estimates in mata for the “covariates”.
Here is the code I wrote:
set obs 100
mata:xw=st_data(.,”B?")
mata:xn=J(100,5,0)
mata:m0=J(100,1,0)
mata:m1=J(100,1,1)
mata:x0=(xw,m0,m0,xn,m0,m0,m0) // reference group
mata:x1=(xw,m0,m0,xw,m0,m0,m0) // group 1 in A, without main effect
mata:x2=(xw,m0,m1,xw,m0,m0,m0) // group 1 in A, with main effect
mata:x3=(xn,m0,m0,xw,m0,m0,m0) // group 1 interaction
Thank you very much!
Related Posts with how to represent estimates for covariates using Mata
Cumulative returns for 1, 2, and 3 year periods using monthly price dataHi all, Could you please advise me how to generate cumulative returns for 1-, 2-, 3-year periods us…
Flipping tables using eststo.Hi, I have a question concerning the construction of tables using eststo and esttab and posting them…
Testing for Equality of Coefficients with Dynamic Panel DataHello! I have conducted a systems-GMM analysis aiming to determine whether a relationship exists be…
Goodness-of-fit measure, mixed-effects GLM, meglmDear all, I have a little question with respect to the output of my regression below. I ran a mixed…
State level panel data, federal level variableI am studying the influence of wind energy on residential electricity price. Panel data set 2000-201…
Subscribe to:
Post Comments (Atom)
0 Response to how to represent estimates for covariates using Mata
Post a Comment