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
Matching values from a panel dataset to a cross-section datasetDear all, I hope you can help me with what seems to be a rather simple issue that i cannot seem to f…
Plot recurrent event survival model(PWP-TT) with Time-Dependent effectsHi everyone, i'm working on a dataset with counting process structure. I have something like this: …
Keep running a replace command until (0 real changes made)Hello! I have a paneldata with the ages of individuals with around 50 million observations. The age …
Drop panel-observations if data have no countHi everyone I have the variables "year" (2009-2019) for each "company key" (e.g.: 1661) and two co…
Formatting Strings: same words being recognized as "different"Hello, I imported a dataset from Excel, but the string variables are being recognized as "different…
Subscribe to:
Post Comments (Atom)
0 Response to Aggregating data and creating Fixed Effects and 1-hour lags of quartics
Post a Comment