# Hierarchical linear modelling in R

I am trying to build a hierarchical linear model based on data structured like this dataset below. The model form I am looking to build is

Purchased ~ f(price + color + more item attributes + age + gender + other person attributes)

Betaprice ~ f(age + gender + other person attributes)

Does anyone know a good approach for this?

 person item purchased age  gender  Color   Price
1   1    1         23   F     Blue      20
1   2    0         23   F     Red       15
1   3    1         23   F     Green     18
2   1    0         34   M     Blue      20
2   2    1         34   M     Red       15
2   3    0         34   M     Green     18
3   1    1         19   M     Blue      20
3   2    1         19   M     Red       15
3   3    0         19   M     Green     18


library(lme4)