Answered You can hire a professional tutor to get the answer.

QUESTION

I need help creating a function that takes anagevalue and returns

Matching on a Single Covariate To account for these differences in age across the two voter populations, let's try to ‘control for‘ age via matching. That is, for each contacted voter, we'll find anon-contacted voter with the same age, and use the set of matched non-contacted voters as our comparison group. First let's assign lD's to people in the control group. It will soon become clear why we‘re doing this. In [82]: #add ID columnnoncontacted = noncontacted.with_column( 'id' , np.arange(noncontacted.num_rows))noncontacted Out[82]: contact vote02 vote98 newreg age female county id 0 1 0 0 68 1 44 00 1 0 0 31 0 44 10 1 1 0 71 1 44 20 0 0 0 45 0 44 30 1 0 0 50 0 44 40 1 0 0 39 1 44 50 1 0 0 64 1 44 60 0 1 0 49 0 44 70 0 0 0 30 0 44 80 0 0 0 49 1 44 9 (14502 rows omitted)

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question