Hi Statalist readers,
I am trying to design controls for a logistic regression to extend Qian and Fullers's analysis of data from Canada's Labour Force Survey during COVID-19 (2020; doi: 10.3138/cpp.2020-077). My plain logistic regression is to measure gender employment gaps ("lfs", or labour force status) according to survey month for single parents of younger and older school-age children. It is as follows:
So far, so good. Now trying to implement some controls:
I (somewhat predictably) get the error: "outcome does not vary; remember: 0 = negative outcome, all other nonmissing values = positive outcome". The one control variable which causes this error to occur is "tenure" (a continuous variable which measures months of employment with present employer). Of course, among those where "tenure">0, their value on "lfs"=1, invariably. So the error makes sense, per my understanding of Stata.
Only, when Qian and Fuller measure the same dependent variable with a logistic regression, they state: "We also include a continuous variable to measure job tenure ["tenure"] with employer (in months). Note that for employed respondents we measure the attributes of their current job, whereas for respondents who were not currently employed, we measure the attributes of their last job" (2020: 590). The latter variable refers to "prevten" or tenure with previous job (in months), which also causes the same error when included.
I'm trying to reconcile Stata with the controls, as described by Qian and Fuller. I think the main issue may be that I don't know how to implement Qian and Fuller's bolded "note" (above), on measuring tenure for the currently employed and measuring "prevten" for those not currently employed. They seem to imply this is done respectively. What kind of code can I use to also treat "tenure" as a control variable in a logistic regression for employment (as Qian and Fuller do), without running into the issue of "outcome does not vary"?
I am trying to design controls for a logistic regression to extend Qian and Fullers's analysis of data from Canada's Labour Force Survey during COVID-19 (2020; doi: 10.3138/cpp.2020-077). My plain logistic regression is to measure gender employment gaps ("lfs", or labour force status) according to survey month for single parents of younger and older school-age children. It is as follows:
Code:
logit lfs sex##survmnth##loneyg[pweight=finalwt], or
Code:
logit lfs sex##survmnth##loneyg age_12 edu labour naics_21 noc_40 cowmain age25 age30 age35 age40 age45 age50 widowed separated divorced snmarried imm10 imm11 nonimm prov tenure [pweight=finalwt], or
Only, when Qian and Fuller measure the same dependent variable with a logistic regression, they state: "We also include a continuous variable to measure job tenure ["tenure"] with employer (in months). Note that for employed respondents we measure the attributes of their current job, whereas for respondents who were not currently employed, we measure the attributes of their last job" (2020: 590). The latter variable refers to "prevten" or tenure with previous job (in months), which also causes the same error when included.
I'm trying to reconcile Stata with the controls, as described by Qian and Fuller. I think the main issue may be that I don't know how to implement Qian and Fuller's bolded "note" (above), on measuring tenure for the currently employed and measuring "prevten" for those not currently employed. They seem to imply this is done respectively. What kind of code can I use to also treat "tenure" as a control variable in a logistic regression for employment (as Qian and Fuller do), without running into the issue of "outcome does not vary"?
Comment