Hi!
I am currently working on a research project aiming at evaluating the effect of a speed-limit reduction on air pollution, using Regression Discontinuity in Time design. In this respect, I have four questions.
First, I would to know how I could condense my data. Indeed, I have average hourly pollution in logs for 6 pollutants between 01/10/2011 and 01/10/2017. I would like to keep these hourly averages, but aggregating them at the weekly level, or maybe at the monthly level. How can I do that?
Second, I have to include control variables in my model. I have chosen five weather variables: temperature, humidity, precipitation, snowfall, and windspeed. I have data per hour for these five variables, for the time window aforementionned. I would like to include current and 1-hour lags of quartics in these five variables. How can I generate such variables?
Third, I would like to include fixed effects in my regressions. More precisely, I would like to include: hours fixed effects, days fixed effects, hours x days fixed effects, hours x weekdays fixed effects, hours x weekends fixed effects, month fixed effects, and holidays fixed effects. I already have a variable, denoted DateTime, that has the format %-tcMonth_dd,_CCYY_HH:MM:SS.
How can I generate variables for hours (1 to 24), days (Monday to Sunday), weekdays (Monday to Friday), weekends (Saturday and Sunday), months (January to December), and holidays (to be determined) from my DateTime variable in order to include these fixed effects in my model?
Finally, I would like to have heteroskedasticity-robust standard errors with correlation within 5-week groups. How can I do such a thing on Stata?
I sincerely thank you all!
Best,
Guillaume
Related Posts with Aggregating data and creating Fixed Effects and 1-hour lags of quartics
Export matrix to Word with asdocx after the predict commandProf River Huang asked the following question Dear Attaullah, Is it possible to put the results …
Creating a new set with every possible pair within a groupDear all, I would like to create a new dataset that includes all possible pairs of observations, wi…
Can the attenuation bias of a demeaned dependent variable be solved by an control function approach?I recently demeaned my dependent variable by a group interaction. Mainly because simply adding them …
Need help with creating certain variablesHi. EmpCode OfficeCode Year Sept_30 In Out Existing 1 11 2011-12 . . 1 12 2011-12 1 . 1 . …
Manipulating local listsIn my code below I expected to get a local macro (myvars2) with a list of all my variables (which ar…
Subscribe to:
Post Comments (Atom)
0 Response to Aggregating data and creating Fixed Effects and 1-hour lags of quartics
Post a Comment