Hello, I'm very new to R and need some general help to get started in R studio.
I need to create a new variable called cd4cat defined as 0 if cd4< 100, 1 if cd4 ∈ [100, 199]
and 2 if cd4 ≥ 200. I've been told to literally type in create a new variable named cd4cat and it just got a big red X next to it so any assistance is appreciated. Below is where I'm at so far.
library(speff2trial)
library(survival)
data(ACTG175)
?ACTG175
Then define:
ACTG175$cd4cat[ACTG175@cd40<100]=0
ACTG175$cd4cat[ACTG175@cd40>=100 & ACTG175@cd40<=199]=1
ACTG175$cd4cat[ACTG175@cd40>=200]=2