# Data and Objective

The data are about lane change maneuvers. I want to predict the lane change duration of a driver of certain age and gender. Following is a very small subset of observations and variables in original data:

• Dependent variable: duration of lane change (1 observation per driver).
• Independent variables: speed of vehicle (multiple obs per driver i.e. from start to end of the lane change), gender & age of driver (1 obs per driver).
Here's a sample data frame:

    df <-  structure(list(driver = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Car1",
"Car2"), class = "factor"), gender = structure(c(2L, 2L, 2L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L), .Label = c("Female", "Male"), class = "factor"), speed = c(40.5,
40.5, 40.7, 41, 41, 38.9, 38.6, 38.8, 39, 39.1, 55, 55, 55, 55.2,
55.3, 25, 25.3, 25.6, 25.6, 25.7), age = c(25, 25, 25, 25, 25,
25, 25, 25, 25, 25, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30),
LC_maneuver = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L), class = "factor", .Label = c("lane_change1",
"lane_change2")), status = structure(c(3L, 1L, 1L, 1L, 2L,
3L, 1L, 1L, 1L, 2L, 3L, 1L, 1L, 1L, 2L, 3L, 1L, 1L, 1L, 2L
), .Label = c("changing lane", "End_of_LC", "Start_of_LC"
), class = "factor"), LC_duration = c(5, 5, 5, 5, 5, 8, 8,
8, 8, 8, 3, 3, 3, 3, 3, 11, 11, 11, 11, 11)), .Names = c("driver",
"gender", "speed", "age", "LC_maneuver", "status", "LC_duration"
), row.names = c(NA, -20L), class = "data.frame")


Please note that each driver has multiple lane changes (at different locations).

# What model is appropriate for these data?

Obviously, multiple linear regression is not appropriate in this case because of both fixed and random effects. I have just started learning about the linear mixed effect models. I found this tutorial which is really helpful for building concepts and contains r code. However, I'm confused if LME model can be used in this case. This is because my dependent variable LC_duration is a single value for a given driver and given LC_maneuver, but a dependent variable, speed is a continuous variable that varies during the duration of a lane change. So my questions are:

• Can I use LME in this case?
• If not, what other model(s) would be more appropriate in this case?