1
$\begingroup$

I have two periods of panel data and I am trying to see if coefficients change over time. I would like to control for individual-level heterogeneity, but not sure how to do it with a complex design object and svyglm function:

# Libraries
library(survey)

# complex survey design
des <- svydesign(
  ~ secu , # stratum half-sample code
  strata = ~stratum , # std error stratum
  weights = ~wtresp , # weights
  nest = TRUE ,
  data = long
)

secu is "the stratum half-sample code for analysis of sampling error using the BRR method or approximate 'two-per-stratum' Taylor Series method (Kish and Hess, 1959). Within the SR sampling error strata, the half sample units are created by dividing sample cases into random halves, HALF SAMPLE CODE = 1 and HALF SAMPLE CODE = 2" (taken from here https://hrs.isr.umich.edu/sites/default/files/biblio/surveydesign.pdf).

In the regression below the outcome variable is the retirement status. The regressors are dummy variables for sex, education, race, self-reported health, age, income. In order to see if the effect of these variables becomes stronger in the second period, I include a time dummy variable which equals to 1 if the respondent's interview is from the 2nd time period, (and 0 if from the 1st). I also include dummy variables for month and year when the interview was collected.

summary(svyglm(
  retired ~ time*(female + college + factor(race) + age + Rshlt + 
            log(iearn + 1) + factor(month) + factor(year)),
  design = des
))

I have tried using plm() with weights, but not sure if it is an appropriate method for complex survey samples.

$\endgroup$
14
  • $\begingroup$ Hi @pawpaw, welcome to CV. Can you provide some more information about what your variables mean, in the body of your question? $\endgroup$
    – Alex J
    Commented Jan 30 at 23:14
  • $\begingroup$ Can the indivual by considering a secondary sampling unit? Then, they could be accounted for by svdesign(ids = ~ secu + individual_id) $\endgroup$
    – Alex J
    Commented Jan 30 at 23:15
  • $\begingroup$ Hi @AlexJ, thank you for your reply. I have added more information about my variables to my question. $\endgroup$
    – pawpaw
    Commented Feb 1 at 1:26
  • $\begingroup$ @AlexJ would you mind clarifying - "Can the indivual by considering a secondary sampling unit?" $\endgroup$
    – pawpaw
    Commented Feb 1 at 1:28
  • $\begingroup$ In "I would like to control for individual-level heterogeneity," - does this mean you have multiple responses per individual? $\endgroup$
    – Alex J
    Commented Feb 1 at 1:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.