Announcement

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

  • Random effects with survey data

    Hi everyone,

    I am looking at the impact of a time-invariant variable using longitudinal survey data. For the same I am trying to use the survey as well as panel data setting. For the dependent variable I have one continuous variable, one binary and one categorical. For the categorical variable "xtmlogit" works perfectly. So, I have 2 questions regarding logit and regress.

    1. For binary variable, xtlogit does not work with survey. The suggestion that I found in this forum is to use melogit. But the melogit command runs r(1400) error.

    I am attaching my code here:
    Code:
     xtset ind time, yearly delta(2)
    gen clwgt = 1
    svyset psu, weight(clwgt) strata (strat) || _n, weight(weight) strata (strat)
    svy: melogit y i.x || ind:

    This results in r(1400) error. I have tried using the noestimate option as well. I have also modified the survey set command as mentioned in the melogit file. Usually, my survey set looks like this for this data:
    [svyset psu [pweight=weight], strata (strata)]

    I currently did my initial calculations using xtmlogit even for this! So they might be wrong since this is not a multinomial logit model and I want to use the right set of commands.

    So I want to ask if I am making an error in syvset or anywhere else. Or is there any other command that I can use.

    2. For continuous variable the mixed command ran the same error. So I ran this:
    Code:
     xtset ind time, yearly delta(2)
    svyset psu [iweight=weight], strata (strat)
    svy jackknife _b: xtreg ami i.inc_status_1, mle i(hhidpn)
    Is this correct or is there something that I should be careful about?

    Thanks!


    Last edited by Sarita Vaswani; 06 Sep 2023, 23:47.
Working...
X