0
$\begingroup$

Apologies if this is a really simple problem, but I couldn't find/couldn't find the right words to look for the answer.

I have daily air temperature data linked to % greenspace (not normaly distributed) and the nearest offical weather station temperature. It looks like this:

 ID  time        avg_temperature  met_temperature   greenspace
2c  2019-01-01   9.1              9.0               0.25
2c  2019-01-01   9.3              8.5               0.25
2c  2019-01-01   7.5              8.7               0.25
2c  2019-01-01   8.5              8.8               0.25
2c  2019-01-01   8.9              8.4               0.25

And so on, for around 600 stations every day for 7 years. A simple analysis shows that as the met_temperature increases, there is a significant difference between the avg_temperature by greenspace %.

model <- lm(avg_temperature  ~ greenspace + met_temperature, data=df)

But what I'd like to answer is 'how much would the avg_temperature change at a weather station on a day if % greenspace was increased/decreased x%'. So, removing met_temperature from the model. The problem with just doing the following:

model <- lm(avg_temperature  ~ greenspace, data=df)

is that the data isn't compared on the same date with comparable met_temperatures.

Thanks,

Jon

$\endgroup$

1 Answer 1

0
$\begingroup$

Could u elaborate on what u mean by that the data is not compared on the same date.

Then, what are greenspace defined as, parks within a city, or forests, or both. And why do u think the amount of greenspace would affect the temperature?

Also, if the met_temperature comes from weather stations. Where is the avg_temperature data from?

Best regards Simon

$\endgroup$
4
  • $\begingroup$ Thanks @simon. The avg_temperature is daily, and the temperature differences (from citizen weather stations) and a linear regression of avg_temperature and met_temperature shows a significant differences between greenspace (% tree canopy) the hotter the daily met_temperature . But, I was hoping to have a model that uses avg_temperature on day (d) with greenspace (x) as independent variables and estimates a new avg_temperature (or change in avg_temperature) given a theoretical % change in tree canopy. Perhaps met_temp needs to stay in the model. $\endgroup$
    – jon
    Nov 11, 2022 at 9:24
  • $\begingroup$ I am sorry but I still don’t understand “is that the data isn't compared on the same date”? $\endgroup$ Nov 11, 2022 at 9:58
  • $\begingroup$ No problem, I am not explaining it well at all. The problem with a simple 'avg_temperature ~ greenspace' model is that it doesn't account for temporal changes in temperature. And I want a model that does account for temperatures on the same date (maybe the mean of all avg_temperatures for each day, met_temperature, whatever). The idea is that - given an input of avg_temperature from a station for a day and the greenspace, the model will estimate a change in avg_temperature given a change in greenspace. $\endgroup$
    – jon
    Nov 11, 2022 at 10:26
  • $\begingroup$ I think I understand. So avg_temperature is a rolling mean, with window=24? Since it changes from hour to hour within a given day? And if you regress it on greenspace it will not only explain the difference in temp at that very hour but also from the other 24h included in the mean? If you don’t have the ‘raw’ data, i.e. the hourly observations, I think what you want (if I understand you correctly) can’t be done. Why not use met_temp as the dependent variable? And how come it is a problem the use the rolling mean? $\endgroup$ Nov 11, 2022 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.