I am trying to run a linear probability model with spatial lagged Xs in R.
The idea is to have the crime_type_1, a binary variable, as the dependent variable, and the faction as the independent variable that is also a binary variable. I have one observation for each crime committed with information on the date, the neighborhood that occurred, and the faction that committed the crime. This means that I don't have a panel because each date and neighborhood is linked to more than one observation. I tried to run a Morans'I test with the command lm.morantest, but I couldn't because the data has more observations than the spatial weighted matrix, which is the number of neighborhoods.
Below we have a small sample of the data that I am using to run the model.
structure(list(neighborhood = c("CORDOVIL", "COSTA BARROS", "INHOAIBA", "BONSUCESSO", "BANGU", "SANTA TERESA"), Date = structure(c(12784, 12784, 12784, 12784, 12784, 12784), class = "Date"), faction = c("TRAFICO", "TRAFICO", "TRAFICO", "TRAFICO", "TRAFICO", "TRAFICO"), crime_type_1 = c(FALSE, FALSE, TRUE, FALSE, FALSE, FALSE)), row.names = c(NA, -6L), class = c("tbl_df", "tbl", "data.frame"))
I would like to know if it is possible to run this model without having a panel dataset. Thank you.