Watts-College / cpp-525-spr-2022

https://watts-college.github.io/cpp-525-spr-2022/
0 stars 0 forks source link

Lab 1: Treatment and TimeSince variables #1

Closed JPRayes closed 2 years ago

JPRayes commented 2 years ago

I'm having issues figuring out how to create the variables "Treatment" and "TimeSince" for the dataset without manually entering in each piece of data. I've tried several different ways to show Treatments 1:120 as "0" and 121:365 as "1" but I continue to get errors. Additionally, I cannot figure out how to code the "TimeSince" variable. Any help is appreciated.

Time <- c(1:365)

Treatment <- as.numeric(1:365 & 1:120==0, 121:365==1)

bus_data <- data.frame(passengers, Time, Treatment)

bus_data