Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to test the interactional effects with the -xtdpdml- command

    I am using the -xtdpdml- to test the interactional effect of gender (time-invariant variable) and motivation to learn (time-variant variable) on the performance of students with a panel data. The illustrating data is as below.

    I have read this paper - "Williams, R., Allison, P. D., & Moral-Benito, E. (2018). Linear dynamic panel-data estimation using maximum likelihood and structural equation modeling. The Stata Journal, 18(2), 293-326. doi:10.1177/1536867x1801800201". But I didn't figure out how to test this interactional effects. Does anyone know how to test interactions with the -xtdpdml- command? Or maybe also share with me paper(s) about how to test interactional effects in cross lagged models?

    The illustrating panel data:
    Code:
    clear all
    ID time gender motivation performance
    1 1 0 2 1
    1 2 0 3 2
    1 3 0 2 1
    1 4 0 3 2
    1 5 0 1 1
    2 1 1 5 4
    2 2 1 4 4
    2 3 1 5 4
    2 4 1 5 5
    2 5 1 4 4
    3 1 0 3 2
    3 2 0 3 3
    3 3 0 3 3
    3 4 0 3 2
    3 5 0 3 3
    4 1 1 1 1
    4 2 1 2 1
    4 3 1 1 1
    4 4 1 1 1
    4 5 1 2 2
    5 1 0 4 5
    5 2 0 4 5
    5 3 0 4 5
    5 4 0 4 4
    5 5 0 3 4
    6 1 1 5 4
    6 2 1 5 4
    6 3 1 3 3
    6 4 1 4 4
    6 5 1 5 5
    Last edited by Victor Smith; 03 Jan 2020, 23:45.

  • #2
    Hi Victor. First off, the help file includes a section on "Interactions with time." You would use the xfree or yfree options for such purposes.

    However, that doesn't sound like what you want. sem (and hence xtdpdml) do not support factor variable notation. You should therefore first compute the interactions yourself, and then include them as time varying variables in your model.

    It doesn't look like you used dataex to create your extract, or if you did something got cut out. If you need further help, repost your data using dataex, as well as the code you are trying to run.
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    Stata Version: 17.0 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment

    Working...
    X