I have this function which does a geographically weighted regression, I have my shape-file, x
for x variable and y
for y variable, the ...
is for the control variables. For example I want to call a regression first but with multiple control variables - how would I do that?
GWR.function <- function(shape1, x, y, ...) {
model <- lm(shape1[[x]] ~ shape1[[y]] + shape1[[...]])
return(summary(model))
}
I assume that it requires the use of a list but I am not sure how to do this.