My data frame: df1
ID year category1 wage
1 2008 1 10
1 2009 1 20
1 2010 1 30
2 2008 0 10
2 2009 0 15
2 2010 0 20
3 2008 0 5
3 2009 1 10
3 2010 1 15
I am trying to run a regression using 'DID' package and applied the following code:
library(did)
df1 <- read.csv(file = 'C:/Users/Jui/Desktop/for_did1.csv')
head(df1)
out3 <- att_gt(yname = "wage",
gname = "category1",
idname = "id",
tname = "year",
xformla = ~1,
data = df1,
control_group = "nevertreated",
anticipation = 0
)
summary(out3)
here, wage is dependent variable and catgegory1 is the treatment
I am getting the following error:
Error in if ((glist[g] <= tlist[(t + 1)])) { : missing value where TRUE/FALSE needed
There is non NaN or NA value in the dataset. But still I am getting the above error