panel.matrices error: no variation in treatment status
pearl-yu opened this issue · 6 comments
Hi,
I got the There is no variation in treatment status error when converting the data to matrix. But there is treatment status change from 0 to 1 for some individuals and also a control group with all 0 values in the treated column. I'm not sure why I'm still getting this error.
# Convert the data into a matrix setup = panel.matrices(modified_data, unit = 'id', time = 'week_number', outcome = 'revenue', treatment = 'treated')
Any help is appreciated. Thx in advance.
The same error.
When I type in unique(modified_data[, 'treated'])
, it returns
treated
0
1
But length(unique(modified_data[, 'treated']))
returns 1.
It returns:
'tbl_df''tbl''data.frame'
Hi, this worked! Thank you so much! I didn't realize the data.frame was converted to a tibble format when doing some data manipulations.