Closed pearl-yu closed 1 year ago
Say this: panel=modified_data; unit='id'; time='week_number'; outcome='revenue'; treatment='treated' Then run this code: https://github.com/synth-inference/synthdid/blob/b839f2cc1685c8fddcf274b882f82e2f6eab3894/R/utils.R#L54C1-L77C4 Then tell me what the variables 'treatment' and 'panel[,treatment]' look like.
The same error.
When I type in unique(modified_data[, 'treated'])
, it returns
But length(unique(modified_data[, 'treated']))
returns 1.
what is class(modified_data[,'treated']) ?
It returns:
'tbl_df''tbl''data.frame'
I do not know what that is. Try converting whatever it is to a data frame by saying as.data.frame(modified_data) and see if you can do something with that.
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.
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.