Announcement

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

  • PISATOOLS package - How can I conduct a linear regression with one interaction?

    Hello everyone,

    I try to analyze PISA 2018 data and, more specifically, I would like to conduct a stepwise regression with an interaction in the second model.
    I am able to create a null model without the interaction by use of two discrete, independent variables: escs_cat (which contains several categories of the escs value) and spktestlang (Child speaks mostly the language of assessment at home as a dummy).
    I use this command:
    pisareg math escs_cat spktestlang

    But when I include an interaction between the country and one of the two independent variables, I get an error:
    pisareg math spktestlang escs_cat##ib1.cnt
    Error: # invalid name

    I tried to test the coding by use of one plausible value and it worked.
    However, I know that this is not sufficient as a result.

    Can somebody please help me?

    Thank you very much in advance
    Best,
    Hannah


  • #2
    I fixed the problem by use of the package pv. I doubt that interactions can be used in Pisatools.
    My final code is
    pv, pv(pv*math) weight(w_fstuwt) brr rw(w_fsturwt*) fays(0.5): ///
    reg @pv i.escs_cat##ib2.cnt_num i.spktestlang##ib2.cnt_num [aw=@w]

    cnt has to be encoded first to be able to use it with the command.

    Comment

    Working...
    X