Using the 'baltimore' housing data from SpData, I want to model the presence of a patio as the response variable, with house price as the explanatory variable. I also want to include weights in my model by housing area.
My code:
library(spData)
library(nlme)
library(dplyr)
library(MASS)
baltimore<-spData::baltimore
baltimore$logpr = log(baltimore$PRICE)
#alright, i want this to be weighted by sqft
w=baltimore$SQFT/100
w
model1 <- glmmPQL(PATIO ~ PRICE , random = ~1|CITCOU, data = baltimore,family=binomial,correlation = corExp(form = ~X + Y, nugget = T),weights = w)
This basically gives me a different error message for each weighting variable I choose. The use of weights here seem to be the only problem here. The weights vector length is the same as the data in the model, so I don't really understan why this isn't working. Any insight appreciated.