STATA 11 for Windows SAMPLE SESSION - Food Security Group ...
STATA 11 for Windows SAMPLE SESSION - Food Security Group ...
STATA 11 for Windows SAMPLE SESSION - Food Security Group ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Stata <strong>11</strong> Sample Session Section 2 – Restructuring Data Files – Table Lookup & Aggregation<br />
• c-q1a.dta: This file contains data on household<br />
roster characteristics. It is at the householdmember<br />
level. We need to use the variables ca3<br />
(age) and ca4 (sex) in this exercise to compute<br />
the number of adult equivalents per household.<br />
• c-q4.dta: This file contains data on crops<br />
produced by the household. The variables we<br />
need to calculate the total production of the<br />
household are:<br />
a. prod - contains the codes <strong>for</strong> the<br />
agricultural crop produced.<br />
b. p1a - contains the codes <strong>for</strong> the unit in<br />
which the production was measured (100 kg<br />
sack, 50 kg sack, etc).<br />
c. p1b - contains the number of units produced<br />
<strong>for</strong> the year.<br />
Note that the unit of production is not a standard unit <strong>for</strong><br />
each crop. For example, a "100 kg sack", as the term is<br />
used in Mozambique, weighs 100 kg only when the sack<br />
is filled with maize. When it is filled with manioc root, it<br />
weighs much less than 100 kg. Thus, we need conversion<br />
factors to be able to convert each of the units in which<br />
production was actually measured to our standard unit,<br />
which is the kilogram.<br />
• conver.dta: This is a table-lookup file. This file<br />
was created specifically to handle the problem of<br />
converting non-standard units to a standard unit.<br />
For each product-unit combination there is a<br />
conversion factor to convert the measurement to<br />
equal the weight in kilograms. In other words,<br />
there is a different conversion factor <strong>for</strong> each<br />
product-unit combination. For example, the<br />
conversion factor <strong>for</strong> a 50 kg sack of rough rice is<br />
39.44; <strong>for</strong> a 50 kg sack of cotton it is 17.5, while a<br />
50 kg sack of peanuts is 41.67. The variables in<br />
this file are:<br />
a. prod - product (crop) code<br />
b. unit - unit of measure<br />
c. conver - conversion factor (equal to the<br />
number of actual kilograms <strong>for</strong> the<br />
combination of prod and unit)<br />
Below, a sample of data from CONVER.DTA shows that:<br />
rice (prod=7) measured in a 20 liter can (unit=8) weighs 19 kg;<br />
rice (prod=7) measured in a 50 kg bag (unit=24) weighs 53 kg;<br />
beans (prod=30) measured in a 20 liter can weighs 17 kg;<br />
beans (prod=30) measured in a 50 kg bag weighs 47 kg.<br />
53