How do I use multilevel regression models? I have crime event data rows:

dayofweek1, region1, hour1, crimetype1
dayofweek2, region2, hour2, crimetype2 ...


and I want to use them as factors to model crime rates/probabilities at the region level.

I also want to use the resulting  model to be able to input factor values to produce crime probabilities. e.g. on Sunday, in region1 there is a .03 chance of burglary at 3pm.

I think I should use a multilevel model, but everything I have found assumes a y value at the individual data row level which I do not have. All the row data are crimes.

Does anyone have an example of such a model (obviously not necessarily crime data, and preferably using python)?

Can the prediction bit be done?
I think what you're looking for is Survival analysis.

From Wikipedia:


  Survival analysis is a branch of statistics for analyzing the expected duration of time until one or more events happen, such as death in biological organisms and failure in mechanical systems.


In your case, you'd like to predict the time a crime will occur in a given region.


Here is a good talk about survival analysis in Python.
This is a python library dedicated to survival analysis and the one used in the video mentioned above. The lib itself has some examples which will also help you understand survival analysis as a whole.
An introduction to the concepts of Survival Analysis and its implementation in lifelines package for Python.


Hope this helps!

EDIT1:

As of the 'per group prediction': your problem is this:


  everything I have found assumes a y value at the individual data row level


There's no such thing as an algorithm to predict a target variable per group. You have to transform your data so it has a 'y' value per group, and then train some model based on that. It may be seen as a regression problem, or maybe as some kind of survival analysis. But you can't escape from the fact that you'll need one target value per group to start doing stuff.