Dear Stata users,
I want to obtain a similar graph, that is commonly used to analyse trends in difference-in-differences.
Array
I am using the following code:
xtset municipality year
xtreg voting time2##newspapers controls, fe vce(cluster municipality)
margins time2#newspapers
marginsplot, xdimension(time2)
time is a variable that takes values between -24 and 23, but when I use it after xtreg, Stata replies "time: factor variables may not contain negative values". So I did: gen time2=time+25.
When I run the above code, I obtain after xtreg:
note: 44.time2 omitted because of collinearity
note: 46.time2 omitted because of collinearity
note: 47.time2 omitted because of collinearity
note: 48.time2 omitted because of collinearity
note: 1.newspapers omitted because of collinearity
note: 10b.time2#0b.newspapers identifies no observations in the sample
note: 11.time2#0b.newspapers identifies no observations in the sample
note: 11.time2#1.newspapers omitted because of collinearity
note: 12.time2#0b.newspapers identifies no observations in the sample
note: 12.time2#1.newspapers omitted because of collinearity
note: 13.time2#0b.newspapers identifies no observations in the sample
note: 13.time2#1.newspapers omitted because of collinearity
note: 14.time2#0b.newspapers identifies no observations in the sample
note: 14.time2#1.newspapers omitted because of collinearity
note: 15.time2#0b.newspapers identifies no observations in the sample
note: 15.time2#1.newspapers omitted because of collinearity
note: 16.time2#0b.newspapers identifies no observations in the sample
note: 16.time2#1.newspapers omitted because of collinearity
note: 17.time2#0b.newspapers identifies no observations in the sample
note: 17.time2#1.newspapers omitted because of collinearity
note: 18.time2#0b.newspapers identifies no observations in the sample
note: 18.time2#1.newspapers omitted because of collinearity
note: 19.time2#0b.newspapers identifies no observations in the sample
note: 19.time2#1.newspapers omitted because of collinearity
note: 20.time2#0b.newspapers identifies no observations in the sample
note: 20.time2#1.newspapers omitted because of collinearity
note: 21.time2#0b.newspapers identifies no observations in the sample
note: 21.time2#1.newspapers omitted because of collinearity
note: 22.time2#0b.newspapers identifies no observations in the sample
note: 22.time2#1.newspapers omitted because of collinearity
note: 23.time2#0b.newspapers identifies no observations in the sample
note: 23.time2#1.newspapers omitted because of collinearity
note: 24.time2#0b.newspapers identifies no observations in the sample
note: 24.time2#1.newspapers omitted because of collinearity
note: 25.time2#1.newspapers omitted because of collinearity
note: 26.time2#0b.newspapers identifies no observations in the sample
note: 26.time2#1.newspapers omitted because of collinearity
note: 27.time2#0b.newspapers identifies no observations in the sample
note: 27.time2#1.newspapers omitted because of collinearity
note: 28.time2#0b.newspapers identifies no observations in the sample
note: 28.time2#1.newspapers omitted because of collinearity
note: 29.time2#0b.newspapers identifies no observations in the sample
note: 29.time2#1.newspapers omitted because of collinearity
For this reason, I obtain an empty graph. Could anyone explain me what I am doing wrong?
Here is an example of my data:
input long municipality float(year newspapers time)
1 1995 0 0
1 2002 0 0
1 2007 0 0
1 2012 0 0
1 2017 0 0
2 1995 1 0
2 2002 1 7
2 2007 1 12
2 2017 1 22
3 1995 0 0
3 2002 0 0
3 2007 0 0
3 2012 0 0
3 2017 0 0
4 1995 1 -13
4 2002 1 -6
4 2012 1 4
4 2017 1 9
Related Posts with Graph trend time DID xtreg
Angrist-Pischke F-Statistic Missing in xtivreg2?Dear all, I have two endogeneous regressors and two instruments. I read that the Kleibergen-Paap rk…
outreg2 for all dataframesHi, I am using Stata 17 and would help in producing tables in all my dataframes. Below is an exampl…
What are the functional form of the fixed-effects regression, random-effects regression and pooled regression?Good morning to the community Stata. I wrote that the functional form of the fixed-effects regressi…
mkspline coefficient interpretation in case of statistical insignificant How can I understand the values of '"p>|t|"? If the p-value of the coefficient is not statistica…
Date-variable: Extracting day-of-month as numericHello everyone, I would highly appreciate your help with the following: I have a date-variable in …
Subscribe to:
Post Comments (Atom)
0 Response to Graph trend time DID xtreg
Post a Comment