Announcement

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

  • Assigning Values to Categorical Variables

    Hey guys,

    At the risk of sounding like a total fool, I have a simple question.

    I'm a student and we've been assigned a dataset on sSAT scores by state, gender, high school ranking, average grade and major.

    I'm trying to understand the relationship between these variables and SAT scores but a lot of them are categorical and as such, STATA doesn't understand them in a regression.

    My question to you is:

    1) How can I assign a value to a categorical variable? (i.e; Make Texas=1, California=2 etc.)

    2) How can I isolate this variable and find out its relationship with SAT scores? (i.e; See if there is a relationship between different majors and SAT scores)

    3) How can I assign more than one categorical variable to a dummy one? (i.e; Group the major subset into Math-Intensive=1, Otherwise=0).

    I appreciate all your help! We've been tasked with figuring out STATA on our own with no guidance, so any sort of direction or support provided will be infinitely helpful.

    Best Regards,
    Andrew Maleki

  • #2
    Andrew:
    A1) you may want to look at -help label-;
    A2) as its face value, this seems a bad idea; see -help regress-, instead;
    A3) I would take a look at -egen-.

    As an aside, the fact that lots of your variable are categorical does not imply that Stata (not STATA) can't understand them as predictors in regression (see -help fvvarlist-).
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X