Announcement

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

  • Listwise Deletion and changing base category

    Hi, I am trying to predict the different levels of financial anxiety based on different predictors and control variables. I am attaching the dataset and do file. I realize that in my data cleaning, I forgot to do a list wise deletion ie I only want to keep observations without any missing data in the predictor variables and I have a lot of predictor variables. My outcome variable has 3 questions and I developed a scale using average sum of score. I would appreciate help on how to do a listwise deletion for my predictor and outcome variables. Also, how do I change the reference category to a different one from the default that STATA picks? Does STATA select the largest reference category? Thank you so much.
    Attached Files

  • #2
    When you compute a model, Stata will do listwise deletion for you. So that is not something you have to do. If you have multiple models with different predictors, you could end up with different numbers of observations for each model. If you want to compare the models (why else would you compute multiple models?) then it is probably a good idea to make sure that you are referring to the same sample. The easiest way to do that is to create an indicator variable. Say you have three models model 1 explains y with the variable A , model 2 explains y with the variables B and C, and model 3 explains y with B, C, and D. Then I would implement that like so (for convenience I will use linear regression, but you can use any estimation command you like)

    Code:
    gen byte touse = !missing(y, A, B, C, D)
    reg y A      if touse  // model 1
    reg y B C    if touse  // model 2
    reg y B C D  if touse  // model 3
    By default the first value is the reference. You can change that. Say our variable A has values 1, 2, and 3. If you type i.A then the value 1 is the reference. If you type ib2.A, then the value 2 is the reference, and if you type ib3.A then ...
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment

    Working...
    X