0

For my statistics final project, I have a data set titled "Finance" and for the edu variable, there are different education levels, which are: trade school degree; some high school; some college, no degree; less than high school; high school diploma / GED; Graduate degree; doctorate / post graduate; bachelor's degree; associate's degree. For my project, I need to have two groups-- college and no college. This is an intro-level college stats class, and I don't have much of a coding background, so any help would be greatly appreciated.

I did not know where to begin; I tried using subset and split.

Gregor Thomas
  • 136,190
  • 20
  • 167
  • 294
  • 2
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. Show the code you tried and describe exactly the problem you are having with it. – MrFlick Feb 21 '23 at 16:49
  • 1
    An `ifelse` statement is usually a good way to go. You can do something like `Finance$college = ifelse(Finanice$edu %in% c("trade school degree", "some college, no degree", "Graduate degree"), "college", "no college")` Of course update which categories go into "college" using your best judgment. – Gregor Thomas Feb 21 '23 at 17:04

0 Answers0