Skip to content

Commit

Permalink
tidy readme
Browse files Browse the repository at this point in the history
  • Loading branch information
theorashid committed Jan 17, 2023
1 parent f18d520 commit 8c6321b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ car.py | - | binomial | $α_0 + β_0 t + α_{1s} + β_{1s} t+

## House price model

This repo also includes
Read in conjunction with Appendix Table 5 of Bennett, Rashid, et al. Lancet Regional Health - Europe 2023.
Linear mixed effects models for log house price
This repo also includes the linear mixed effects model for estimating house prices, implemented in `house_price.R`.
The model has effects for space, time, housing type, ownership type, new or old, season, number of bedrooms.
See Appendix Table 5 of Bennett 2023 for more information.

## Data availability

Expand Down
28 changes: 14 additions & 14 deletions mortality_statsmodel/house_price.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
library(lme4)

house_price_model <- lmer(
Lprice ~ (1 + quart | oa_id) + # log(price) ~ theta_O and phi_O :- OA level intercepts and slopes
(1 + quart | lsoa_id) + # theta_L and phi_L :- LSOA level intercepts and slopes
(1 + quart | msoa_id) + # theta_M and phi_M :- MSOA level intercepts and slopes
(1 + quart | lad_id) + # theta_D and phi_D :- District level intercepts and slopes
q1 + # lamda_quarter :- Non-linear time
(1 | q1_lad_id) + # eta_D,quarter :- Non-linear time, district offsets
Type + # delta_1,type, :- Type intercept; flat, terraced house, semi-detached house, detached house
FreeL + # delta_2,ownership :- Ownership intercept; leasehold, freehold
nBedrooms + # delta_3,beds :- Beds intercept; studio, 1-, 2-, 3-, 4- and 5-bedrooms, 6/7/8-bedrooms
NewOld + # delta_4,newold :- New/old intercept; old
Season + # delta_5,season :- Season intercept; spring (March-May), summer (June-August),autumn (September-November), winter (December-February))
Type:quart + # tau_1,type :- Type linear time slope; flat, terraced house, semi-detached house, detached house
nBedrooms:quart + # tau_2,beds :- Beds linear time slope; studio, 1-, 2-, 3-, 4- and 5-bedrooms, 6/7/8-bedrooms
(1 | nBedrooms_lad_id), # omega_D,beds :- Beds intercepts, district offsets
Lprice ~ (1 + quart | oa_id) + # log(price) ~ theta_O + phi_O - OA level intercepts and slopes
(1 + quart | lsoa_id) + # theta_L + phi_L - LSOA level intercepts and slopes
(1 + quart | msoa_id) + # theta_M + phi_M - MSOA level intercepts and slopes
(1 + quart | lad_id) + # theta_D + phi_D - District level intercepts and slopes
q1 + # lamda_quarter - Non-linear time
(1 | q1_lad_id) + # eta_D, quarter - Non-linear time, district offsets
Type + # delta_1, type - Type intercept; flat, terraced house, semi-detached house, detached house
FreeL + # delta_2, ownership - Ownership intercept; leasehold, freehold
nBedrooms + # delta_3, beds - Beds intercept; studio, 1-, 2-, 3-, 4-, 5-, 6/7/8- bedrooms
NewOld + # delta_4, newold - New/old intercept
Season + # delta_5, season - Season intercept; spring (March-May), summer (June-August), autumn (September-November), winter (December-February)
Type:quart + # tau_1, type - Type linear time slope; flat, terraced house, semi-detached house, detached house
nBedrooms:quart + # tau_2,beds - Beds linear time slope; studio, 1-, 2-, 3-, 4-, 5-, 6/7/8- bedrooms
(1 | nBedrooms_lad_id), # omega_D, beds - Beds intercepts, district offsets
data = dat
)

0 comments on commit 8c6321b

Please sign in to comment.