Econ 488 Applied Managerial Econometrics

Total Page:16

File Type:pdf, Size:1020Kb

Econ 488 Applied Managerial Econometrics

Econ 488 – Applied Managerial Econometrics Cameron Kaplan, Fall 2010 9/10/10 Lab 2 – Descriptive Statistics in Gretl

Entering Data in Gretl (Norusis, Ch. 4, Data Analysis Problem 1)

Twenty-five children were asked to sample each of three brands of cereals: Canary Crunch, Turtle Treats, and Ghostly Shadows. They were asked to choose their favorite and indicate how much they liked it (crazy about it, liked it, didn’t particularly like it). They were also asked to select which of four “gifts” they’d like to find in it: a marble, a squirt gun, a whistle, or a magic ring. Here are their responses:

Table 1. Data Child Cereal Like Gift Gender Age 1 Ghostly Shadows crazy squirt gun M 8 2 Ghostly Shadows like squirt gun M 9 3 Ghostly Shadows not part squirt gun M 7 4 Canary Crunch not part ring M 11 5 Turtle Treats crazy squirt gun F 6 6 Turtle Treats crazy ring F 11 7 Turtle Treats crazy squirt gun F 9 8 Turtle Treats like ring F 5 9 Ghostly Shadows crazy ring M 7 10 Canary Crunch not part squirt gun F 11 11 Turtle Treats crazy squirt gun F 10 12 Ghostly Shadows like ring F 6 13 Turtle Treats crazy squirt gun M 8 14 Turtle Treats like ring M 10 15 Ghostly Shadows crazy whistle F 10 16 Canary Crunch don’t know ring M 7 17 Turtle Treats crazy whistle F 8 18 Turtle Treats like ring F 8 19 Ghostly Shadows like squirt gun F 12 20 Turtle Treats crazy can’t decide M 9 21 Canary Crunch like ring F 8 22 Turtle Treats crazy squirt gun M 8 23 Ghostly Shadows like ring F 11 24 Turtle Treats like ring F 5 25 Turtle Treats crazy ring F 8

Procedure: 1. Open Gretl. Select File> New Data Set. Choose 25 observations (you can always change this later), Cross-sectional format, and click apply. Select yes when it asks you if you want to start entering values. 2. Name your first variable child. In the window that pops up, select Variable > Add, and create a variable called cereal. Repeat this several times, creating variables called like, gift, gender, and age.

NOTE: Variable names are always short. They cannot be longer than 8 letters, and cannot start with a number. Often they are given a short descriptive name. You can also provide a several word description of the variable for your own reference. For example, you may want to give the variable child, the description “Child Identification Number.” To do this go to the main window, click on the variable that you want to add a description for, and go to Variable > Edit Atributes.

3. Gretl does not allow you to create string variables (i.e. variables with words or letters), so instead, you will have to assign each observation a numeric value. It is customary to create a reference “codebook,” which translates the each numerical value into meaningful string. Below is an example of a codebook that could be used for this data:

Table 2. Codebook. Variable Name Possible Values child 1 to 25 cereal 1 = Canary Crunch 2 = Turtle Treats 3 = Ghostly Shadows -9 = Missing like 1 = Crazy about it 2 = Liked it 3 = Didn’t Particularly Like it -9 = Missing gift 1 = Marble 2 = Squirt Gun 3 = Whistle 4 = Magic Ring -9 = Missing gender 1 = Male 2 = Female -9 = Missing age 0 to 99

4. Now enter the data. Type in the data as shown in table 1. For cereal, like, gift, and gender, type the number corresponding to the value. For example, type 1 instead of “Canary Crunch.” Notice that one person responded “don’t know” for whether they liked the cereal, and one person responded “can’t decide” for the gift. We will code these as “missing.” Often in data sets, missing values are assigned negative values. Assign a value of -9 for each “don’t know” or “can’t decide.” When you are done entering data click Apply, then Close. 5. You will need to tell Gretl that -9 is the code for missing, so it will leave these observations out of your analyses. Highlight the variable cereal, and go to Variable > Set Missing Value Code… Type -9, and then click OK. Repeat this for like, gift,and gender. 6. The discussion questions ask you to analyze the frequencies and descriptive statistics. To do this, go to click on the variable of interest and select Variable > Frequency Distribution. To create a histogram, go to Variable > Frequency Plot. To calculate summary statistics, including mean, standard deviation min and max, choose Summary Statistics from the Variable menu. Write-Up 1. What percentage of the sample are males and what percentage are females? 2. Which cereal was preferred by most children? Include a table of the percentage of children that liked each cereal. 3. Based on your sample, which gift would you include in the cereal boxes? Explain the basis for your choice. Also include a histogram. Be sure to provide a key for your histogram if it is unclear which bars represent which cereals. 4. What percentage of children were crazy about their favorite cereal? Add up the frequencies (not the percent) for each possible answer. What do you get? Why is this different from the total number of observations? 5. Calculate summary statistics for age. What is the average age in your sample? The standard deviation? How old are the youngest and oldest participants?

Recommended publications