It's weird. I am sure that I run successfully before. But I cannot now.
> reg.fe <- felm(daily_kwh ~ post + post:treatment|customer_id, data = df)
Error in chol.default(mat[ok, ok]) : 'a' must have dims > 0
I didn't have the above error message before. What happened?
library(lfe) #fixed effect
# my data set:
df <- data.frame(
stringsAsFactors = FALSE,
treatment = c(1L,1L,1L,1L,1L,1L,1L,
1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,
1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,
1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L),
customer_id = c(1L,1L,1L,1L,1L,1L,1L,
1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,1L,
1L,1L,1L,2L,2L,2L,2L,2L,2L,2L,2L,2L,2L,
2L,2L,2L,2L,2L,2L,2L,2L,2L,2L,2L,2L,2L,2L),
post = c(0,0,0,0,0,0,0,0,0,
0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
1,1),
daily_kwh = c(49.969696969697,51,
49.2424242424242,24.3396226415094,34.75,48.1666666666667,
78.3103448275862,62.0606060606061,48.7142857142857,
37.3,52.03125,56.3870967741936,55.5806451612903,
51.1379310344828,44.1034482758621,31.8666666666667,
33.3333333333333,51.6896551724138,64.40625,54,
45.2758620689655,38.1818181818182,38.1785714285714,
53.0967741935484,65.1212121212121,70.2068965517241,
66.3225806451613,35.0666666666667,28.1428571428571,
27.5483870967742,34.84375,42.4666666666667,39.3103448275862,
35.875,50.9310344827586,55.9,70.78125,128.533333333333,
122.551724137931,84.9375,42.0333333333333,