#### 联系方式

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-23:00
• 微信：codinghelp2

#### 您当前位置：首页 >> Algorithm 算法作业Algorithm 算法作业

###### 日期：2020-01-31 11:14

Assignment #1

This assignment uses data from a randomized experiment undertaken by Benhassine et al (2015) in

Morocco. The purpose of the experiment was to determine the effectiveness of cash transfers as an

incentive for families to make educational investments in their children. The experiment explicitly

targeted poor rural communities, where more than 40 percent of children drop out of school before

completing the full six years of primary education.

The experiment was undertaken in 320 rural school sectors (these are like school districts, or

communities). Each school sector was randomly assigned to a control group or one of four treatment

groups. All families with school-age children who resided in one of these 320 school sectors were part of

the experiment. Families in the control group received no cash transfers. Families in two of the treatment

groups received a small monthly cash transfer that was conditional: to receive the monthly transfer, their

children needed to attend school regularly. Within this group, families were further randomized into one

of two groups: one in which the cash transfer was paid to the mother, and one in which the cash transfer

was paid to the father. Families in the other two treatment groups received a small monthly cash transfer

that was unconditional: families were told that the purpose of the transfer was to support their children’s

education, but they received the transfer whether their children attended school regularly or not. Again,

families within this group were randomized into one of two groups: one where the transfer was paid to the

mother, and one whether the transfer was paid to the father.

So, to summarize, families were randomly assigned to one of five groups (group and benef are

variables in the data for this assignment, described further below):

group Transfer Type Transfer recipient (benef)

Control 0 None n/a

Treatment 1 Unconditional Mother

Treatment 1 Unconditional Father

Treatment 2 Conditional Mother

Treatment 2 Conditional Father

The data for this assignment are a subset of the data collected at the experiment’s “baseline”, i.e., at the

start of the experiment. At baseline, families had been randomly assigned to the treatment and control

groups, but did not know the details of the experiment and had not yet begun to receive treatment. You’ll

find the data in the excel file a1_baseline.xls. Each row corresponds to one household. Variable names are

in the first row, and are as follows:

Variable name Description

hhid ID number of the household

schoolid ID number of the school sector

group indicates whether family is in control group (0), unconditional transfer group (1),

or conditional transfer group (2); see table above

benef indicates whether transfer recipient is Mother or Father; see table above

province Province of residence

survey_status Indicates whether family completed baseline survey or not

hhsize Number of people residing in this home

dwellingsize Floor area of home in m2

electricity Indicates whether the home is connected to electrical network

watersuppply Indicates whether the home is connected to water network

child1 Indicates whether there is at least one child (child #1) age 6-15 residing in this

home

child1_inschool Indicates whether child #1 is currently enrolled in school

child2 Indicates whether there is a second child (child #2) age 6-15 residing in this home

child2_inschool Indicates whether child #2 is currently enrolled in school

child3 Indicates whether there is a third child (child #3) age 6-15 residing in this home

child3_inschool Indicates whether child #3 is currently enrolled in school

child4 Indicates whether there is a fourth child (child #4) age 6-15 residing in this home

child4_inschool Indicates whether child #4 is currently enrolled in school

When doing a randomized experiment, it’s usually a good idea to check whether there’s any evidence that

the randomization was done incorrectly. We can do that by looking for evidence that the baseline

characteristics of treatment and control groups are systematically different. That’s what you’ll do in this

assignment.

Answer each of the following questions using R. Assemble your R code, output, and a short written

answer to each question in a nicely formatted html document. To create that nicely formatted html

document, use the RMarkdown template provided to you (and don’t forget to knit it!). When

you’ve finished the assignment, upload the html file via Canvas.

1) Create a new variable called treatment that equals: zero if the household is in the control group;

one if the household received an unconditional transfer paid to the mother; two if the household

received an unconditional transfer paid to the father; three if the household received a conditional

transfer paid to the mother; and four if the household received a conditional transfer paid to the

father. Report the number of households in the control group and each of the four treatment groups.

2) For the control group and each of the treatment groups, report:

- the average number of people residing in the home

- the average floor area of the home

- the proportion of homes connected to the electrical network

- the proportion of homes connected to the water network

- the average number of children residing in this home

- the average number of children enrolled in school

Do these means and proportions provide any evidence that the treatment and control groups are

“unbalanced,” i.e., that there are systematic differences in treatment and control groups at baseline?

3) For each of the four treatment groups, test whether the average number of people residing in this

home is different than the control group mean at the 5% level of significance.

(No, we haven’t discussed how to do this test, but I have given you the tools you need to build a

reasonable test. There are many ways to do it. Be creative!)