I have a variable (FTA) that has 2 options (yes or no), and I want to create a dummy variable to replace it with yes=1 and no=0. From time period (t) 3 and onwards, it should equal 1, and before that should be 0.
df<-dummy.data.frame(df, names=c("FTA"), sep="_")
After inputting this line of code, I can't see any difference from before when I view the summary of the data (it still counts the number of no's and yes's in the column below the variable name).
I also tried doing:
dummy <- as.numeric(t >= 3)
dummy2 <- as.numeric(t < 3)
As well as:
ifelse(t >=3, 1, 0)
But I still can't observe any changes in the summary. Have I done this correctly, and what can I do to view the dummy variable I created and to replace the old one with it?
Edit: Example of data
My goal is to create a dummy variable that replaces "FTA".