I want to test gender differences in an outcome variable called the willingness to pay
. My data consists of records with following three fields: person_id
, person_gender
, and willingness_to_pay
(in dollars). Willingness to pay was obtained from some users multiple times. So I have multiple records for some users.
I understand that following would be incorrect:
t.test(willingness_to_pay ~ person_gender, paired = FALSE, data = myData)
How do I account for nesting with person_id
? Please help.
lmer(willingness_to_pay ~ person_gender + (1|person_id), data=myData)
? $\endgroup$