Good afternoon,
I have a panel data that looks like the following:
In this panel data:
Independent variables: Bth, Dth, int_y, ptn_y
Mediating variables: o_in, m_in
Depending variables: patnum, pat_epus
Control variables: sales, size, exportn, industry, gextid, country, newage
With this panel data I would like to analyze the direct and indirect effect that the independents variables have on the dependent variables. Looking for recommendation of how to perform this analysis I have found that in stata, the SEM command can be used to obtain both the direct and indirect effect when performing mediation. As the data need to be arranged in wide format to perform the analysis, a limitation that I have seen is that I am only able to perfom the analysis in a cross sectional matter. Is there a way to perform this analysis with SEM including the longitudinal characteristic of the dataset?
Also, as the dependent variables patnum and patent_epus represent the number of “pat” requested of each type for the firms in the years analyzed, is it ok to use the “sem” command or is it better to use the “gsem” command?
Thank you very much in advanced for your help.
Jose Luis
I have a panel data that looks like the following:
ID | year | Bth | Dth | int_y | ptn_y | o_in | m_in | patnum | pat_e | sales | size | exportn | industry | gextid | country | age |
20 | 2008 | 8 | 2 | 1 | 3 | 1 | 1 | 0 | 0 | 39389620 | 63 | 25.1 | 15 | 7.4 | 1 | 61 |
20 | 2011 | 10 | 2 | 4 | 5 | 3 | 4 | 1 | 0 | 52623691 | 152 | 40.7 | 15 | 0 | 1 | 64 |
20 | 2014 | 10 | 3 | 1 | 6 | 3 | 4 | 1 | 0 | 110100000 | 101 | 36.6 | 15 | 42.4 | 1 | 67 |
22 | 2008 | 10 | 1 | 2 | 3 | 2 | 0 | 0 | 0 | 496600000 | 1489 | 7 | 22 | 0 | 1 | 66 |
22 | 2011 | 10 | 4 | 1 | 6 | 3 | 2 | 8 | 4 | 511000000 | 1784 | 40.6 | 22 | 0 | 1 | 69 |
22 | 2014 | 10 | 4 | 2 | 5 | 2 | 0 | 7 | 2 | 384200000 | 1569 | 72.7 | 22 | 0 | 1 | 72 |
25 | 2008 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21834200 | 154 | 5.4 | 15 | 16.4 | 1 | 60 |
25 | 2011 | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 21796024 | 134 | 4.9 | 15 | 2 | 1 | 63 |
25 | 2014 | 8 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 23578268 | 124 | 6.4 | 15 | 0 | 1 | 66 |
27 | 2008 | 9 | 3 | 1 | 3 | 2 | 1 | 4 | 3 | 52746431 | 462 | 1 | 12 | 3.3 | 1 | 44 |
27 | 2011 | 9 | 3 | 1 | 3 | 1 | 0 | 0 | 0 | 42999533 | 330 | 0 | 12 | 0 | 1 | 47 |
27 | 2014 | 8 | 0 | 1 | 2 | 1 | 1 | 0 | 0 | 44002188 | 357 | 51.9 | 12 | 0 | 1 | 50 |
30 | 2008 | 7 | 3 | 2 | 3 | 3 | 1 | 0 | 0 | 574600000 | 126 | 0 | 13 | 31.3 | 1 | 43 |
30 | 2011 | 10 | 5 | 0 | 0 | 2 | 2 | 0 | 0 | 381700000 | 134 | 4.2 | 13 | 12 | 1 | 46 |
30 | 2014 | 10 | 4 | 1 | 2 | 0 | 0 | 1 | 0 | 354700000 | 121 | 2.2 | 13 | 5.5 | 1 | 49 |
32 | 2008 | 7 | 2 | 0 | 2 | 2 | 1 | 0 | 0 | 37786689 | 88 | 8.9 | 23 | 0 | 1 | 39 |
32 | 2011 | 7 | 2 | 0 | 0 | 0 | 2 | 0 | 0 | 17159611 | 67 | 0.9 | 23 | 0 | 1 | 42 |
32 | 2014 | 8 | 4 | 0 | 1 | 0 | 0 | 0 | 0 | 12281532 | 83 | 1 | 23 | 0 | 1 | 45 |
33 | 2008 | 2 | 0 | 0 | 0 | 2 | 3 | 0 | 0 | 62449255 | 378 | 15 | 14 | 0 | 1 | 34 |
33 | 2011 | 2 | 0 | 0 | 0 | 2 | 3 | 0 | 0 | 31658394 | 240 | 0 | 14 | 0 | 1 | 37 |
33 | 2014 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26131847 | 200 | 0 | 14 | 0 | 1 | 40 |
36 | 2008 | 6 | 2 | 0 | 0 | 0 | 0 | 2 | 2 | 4349675 | 56 | 0 | 18 | 0 | 1 | 52 |
36 | 2011 | 5 | 2 | 0 | 0 | 3 | 4 | 5 | 5 | 8511439 | 92 | 0 | 18 | 0 | 1 | 55 |
36 | 2014 | 6 | 2 | 2 | 1 | 2 | 3 | 0 | 0 | 7360923 | 82 | 50.3 | 18 | 0 | 1 | 58 |
40 | 2008 | 10 | 2 | 1 | 4 | 0 | 0 | 0 | 0 | 25614595 | 44 | 0 | 10 | 7.4 | 0 | 33 |
40 | 2011 | 10 | 3 | 1 | 2 | 0 | 0 | 0 | 0 | 25171278 | 45 | 0.8 | 10 | 6.3 | 0 | 36 |
40 | 2014 | 10 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 24140456 | 44 | 2.5 | 10 | 0 | 0 | 39 |
42 | 2008 | 6 | 0 | 1 | 2 | 1 | 0 | 0 | 0 | 372300000 | 238 | 3.5 | 14 | 0 | 1 | 33 |
42 | 2011 | 9 | 0 | 1 | 3 | 3 | 0 | 0 | 0 | 262400000 | 225 | 5.2 | 14 | 20.3 | 1 | 36 |
42 | 2014 | 9 | 0 | 1 | 5 | 3 | 0 | 0 | 0 | 284300000 | 228 | 0.5 | 14 | 16.4 | 1 | 39 |
43 | 2008 | 8 | 1 | 0 | 0 | 2 | 1 | 0 | 0 | 18024408 | 80 | 0 | 19 | 20.9 | 1 | 35 |
43 | 2011 | 7 | 0 | 0 | 0 | 2 | 1 | 0 | 0 | 19699301 | 90 | 0 | 19 | 16.1 | 1 | 38 |
43 | 2014 | 7 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 20152976 | 99 | 0 | 19 | 0 | 1 | 41 |
46 | 2008 | 8 | 3 | 1 | 3 | 1 | 1 | 0 | 0 | 17146389 | 75 | 0.5 | 17 | 2.4 | 1 | 30 |
46 | 2011 | 9 | 2 | 0 | 2 | 1 | 1 | 0 | 0 | 20721491 | 70 | 0.3 | 17 | 2.7 | 1 | 33 |
46 | 2014 | 7 | 2 | 0 | 0 | 2 | 0 | 0 | 0 | 27607344 | 75 | 0.3 | 17 | 19.3 | 1 | 36 |
57 | 2008 | 6 | 2 | 0 | 0 | 0 | 0 | 1 | 0 | 22878934 | 21 | 1.9 | 17 | 99.5 | 1 | 20 |
57 | 2011 | 10 | 4 | 0 | 0 | 0 | 0 | 1 | 0 | 14147998 | 26 | 1.9 | 17 | 100 | 1 | 23 |
57 | 2014 | 10 | 4 | 0 | 0 | 0 | 1 | 1 | 0 | 10609470 | 26 | 2.8 | 17 | 100 | 1 | 26 |
62 | 2008 | 10 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2290688 | 17 | 34.5 | 16 | 0 | 1 | 15 |
62 | 2011 | 10 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 2346570 | 15 | 15.2 | 16 | 0 | 1 | 18 |
62 | 2014 | 10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1719451 | 14 | 8.9 | 16 | 0 | 1 | 21 |
63 | 2008 | 9 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 21529736 | 108 | 42.9 | 15 | 0 | 1 | 18 |
64 | 2008 | 10 | 3 | 3 | 4 | 3 | 4 | 3 | 2 | 10300167 | 52 | 51.6 | 15 | 0 | 1 | 18 |
64 | 2011 | 10 | 1 | 0 | 1 | 3 | 4 | 0 | 0 | 9212141 | 35 | 44 | 15 | 0 | 1 | 21 |
64 | 2014 | 9 | 5 | 0 | 5 | 3 | 3 | 1 | 0 | 10609470 | 40 | 46.4 | 15 | 0 | 1 | 24 |
65 | 2011 | 5 | 2 | 0 | 0 | 2 | 0 | 0 | 0 | 3239057 | 30 | 30.9 | 12 | 0 | 1 | 21 |
66 | 2008 | 9 | 0 | 0 | 1 | 0 | 0 | 4 | 1 | 22136526 | 100 | 21.8 | 17 | 6.7 | 0 | 17 |
66 | 2011 | 10 | 0 | 0 | 0 | 0 | 0 | 2 | 1 | 12129950 | 77 | 25 | 17 | 0 | 1 | 20 |
66 | 2014 | 10 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 11536365 | 62 | 51.4 | 17 | 21.2 | 1 | 23 |
68 | 2008 | 6 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 19244274 | 107 | 0.4 | 17 | 13.6 | 1 | |
72 | 2008 | 7 | 1 | 2 | 4 | 1 | 0 | 0 | 0 | 375100000 | 833 | 47.7 | 14 | 7.5 | 1 | 15 |
72 | 2011 | 7 | 1 | 1 | 4 | 3 | 0 | 0 | 0 | 231000000 | 749 | 38.1 | 14 | 25.2 | 1 | 18 |
72 | 2014 | 7 | 2 | 1 | 5 | 1 | 0 | 0 | 0 | 324900000 | 798 | 53.1 | 14 | 21.2 | 1 | 21 |
74 | 2008 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 17487783 | 307 | 0 | 21 | 0 | 1 | 15 |
74 | 2014 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49747173 | 2591 | 4.4 | 21 | 100 | 1 | 21 |
75 | 2008 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 182500000 | 248 | 0.9 | 14 | 0 | 1 | 14 |
75 | 2014 | 5 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 69436368 | 190 | 2.5 | 14 | 0 | 1 | 20 |
77 | 2008 | 10 | 2 | 1 | 2 | 2 | 0 | 0 | 0 | 6023716 | 50 | 7 | 15 | 10 | 1 | 14 |
77 | 2011 | 10 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 7237005 | 58 | 0 | 15 | 0 | 1 | 17 |
82 | 2008 | 10 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 42801299 | 100 | 0 | 18 | 0 | 0 | 12 |
82 | 2011 | 10 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 26827256 | 52 | 0 | 18 | 0 | 0 | 15 |
82 | 2014 | 10 | 2 | 0 | 4 | 0 | 0 | 13 | 0 | 11847118 | 55 | 0 | 18 | 0 | 0 | 18 |
88 | 2008 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 61785588 | 365 | 67.8 | 15 | 0 | 1 | 11 |
88 | 2011 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 70115789 | 332 | 34.5 | 15 | 0 | 1 | 14 |
88 | 2014 | 4 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 77315502 | 372 | 41 | 15 | 0 | 1 | 17 |
Independent variables: Bth, Dth, int_y, ptn_y
Mediating variables: o_in, m_in
Depending variables: patnum, pat_epus
Control variables: sales, size, exportn, industry, gextid, country, newage
With this panel data I would like to analyze the direct and indirect effect that the independents variables have on the dependent variables. Looking for recommendation of how to perform this analysis I have found that in stata, the SEM command can be used to obtain both the direct and indirect effect when performing mediation. As the data need to be arranged in wide format to perform the analysis, a limitation that I have seen is that I am only able to perfom the analysis in a cross sectional matter. Is there a way to perform this analysis with SEM including the longitudinal characteristic of the dataset?
Also, as the dependent variables patnum and patent_epus represent the number of “pat” requested of each type for the firms in the years analyzed, is it ok to use the “sem” command or is it better to use the “gsem” command?
Thank you very much in advanced for your help.
Jose Luis
Comment