Announcement

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

  • use of categorical variable among the covariates when using pscore command to perform PSM

    Hello,

    I'm new to Stata, so I would appreciate your patience. Currently, I am interested in conducting propensity score matching using cross-sectional data. Specifically, I want to explore the impact of migration on health outcomes. To achieve this, I intend to utilize the "pscore" command, which allows me to create a propensity score. The command structure I plan to use is as follows: "pscore treatment covariate1 covariate2 … covariate#, pscore(mypscore) blockid(myblock)logit detail." However, I am encountering an issue when working with categorical variables in my dataset, as Stata is giving me a response stating that "factor variables and time-series operators are not allowed." I would appreciate your guidance on how to incorporate categorical variables into the "pscore" command or if there is an alternative approach to address this.

  • #2
    You need to create dummy variables for each categorical variables and include them (less the base to avoid dummy trap).

    can use

    Code:
    tab catvar , gen(catvar_)

    Comment

    Working...
    X