Question

In: Math

Use the data in the file andy.dta consisting of data on hamburger franchises in 75 cities...

Use the data in the file andy.dta consisting of data on hamburger franchises in 75 cities from Big Andy's Burger Barn.

Set up the model

ln(Si)=b1 + b2ln(Ai) + ei,

where

Si = Monthly sales revenue ($1000s) for the i-th firm

Ai = Expenditure on advertising ($1000s) for the i-th firm

(a) Interpret the estimates of slope and intercept.

(b) How well did the model fit to the data? Use any tests and measures presented in class.

(c) Perform any test for heteroscedasticity in your data.

sales price advert
73.2 5.69 1.3
71.8 6.49 2.9
62.4 5.63 0.8
67.4 6.22 0.7
89.3 5.02 1.5
70.3 6.41 1.3
73.2 5.85 1.8
86.1 5.41 2.4
81 6.24 0.7
76.4 6.2 3
76.6 5.48 2.8
82.2 6.14 2.7
82.1 5.37 2.8
68.6 6.45 2.8
76.5 5.35 2.3
80.3 5.22 1.7
70.7 5.89 1.5
75 5.21 0.8
73.7 6 2.9
71.2 6.37 0.5
84.7 5.33 2.1
73.6 5.23 0.8
73.7 5.88 1.1
78.1 6.24 1.9
75.7 5.59 2.1
74.4 6.22 1.3
68.7 6.41 1.1
83.9 4.96 1.1
86.1 4.83 2.9
73.7 6.35 1.4
75.7 6.47 2.5
78.8 5.69 3
73.7 5.56 1
80.2 6.41 3.1
69.9 5.54 0.5
69.1 6.47 2.7
83.8 4.94 0.9
84.3 6.16 1.5
66 5.93 2.8
84.3 5.2 2.3
79.5 5.62 1.2
80.2 5.28 3.1
67.6 5.46 1
86.5 5.11 2.5
87.6 5.04 2.1
84.2 5.08 2.8
75.2 5.86 3.1
84.7 4.89 3.1
73.7 5.68 0.9
81.2 5.83 1.8
69 6.33 3.1
69.7 6.47 1.9
78.1 5.7 0.7
88 5.22 1.6
80.4 5.05 2.9
79.7 5.76 2.3
73.2 6.25 1.7
85.9 5.34 1.8
83.3 4.98 0.6
73.6 6.39 3.1
79.2 6.22 1.2
88.1 5.1 2.1
64.5 6.49 0.5
84.1 4.86 2.9
91.2 5.1 1.6
71.8 5.98 1.5
80.6 5.02 2
73.1 5.08 1.3
81 5.23 1.1
73.7 6.02 2.2
82.2 5.73 1.7
74.2 5.11 0.7
75.4 5.71 0.7
81.3 5.45 2
75 6.05 2.2

Solutions

Expert Solution

We can run this using the open source statisitcal Package R , the R snippet is as follows

andy <- read.csv(file.choose())


## fit the regression

fit <- lm(log(sales)~log(advert),data=andy)

summary(fit)

fit$coefficients


par(mfrow=c(2,2)) # init 4 charts in 1 panel
plot(fit)

## test for heterscadisicity

car::ncvTest(fit)

The results are

summary(fit)

Call:

lm(formula = log(sales) ~ log(advert), data = andy)

Residuals:

Min 1Q Median 3Q Max

-0.180134 -0.054071 0.000106 0.062748 0.168751

Coefficients:

Estimate Std. Error t value Pr(>|t|)   

(Intercept) 4.32290 0.01283 337.059 <2e-16 ***

log(advert) 0.04554 0.01784 2.553 0.0128 *  

---

Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.08146 on 73 degrees of freedom

Multiple R-squared: 0.08197, Adjusted R-squared: 0.06939 # the model can explain only 8% variation in the data , hence it is not a good model

F-statistic: 6.518 on 1 and 73 DF, p-value: 0.01277

fit$coefficients
(Intercept) log(advert)
4.32290054 0.04553909

the regression equation is formed using the coefficients as

ln(sales) = 4.322 + 0.0455*log(advert)

car::ncvTest(fit)
Non-constant Variance Score Test
Variance formula: ~ fitted.values
Chisquare = 0.01313877 Df = 1 p = 0.9087428

test have a p-value not less than a significance level of 0.05, therefore we cant reject the null hypothesis that the variance of the residuals is constant and infer that heteroscedasticity is not present, thereby confirming our graphical inference.


Related Solutions

What do cities hope to gain by attracting franchises?
What do cities hope to gain by attracting franchises?
1.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and...
1.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and heart weight (in grams) for 12 cats. Give the estimated regression line using the body weight as the predictor variable (x-variable) and the heart weight as the response variable (y-variable). Also, provide interpretations in terms of the problem for the slope and the y-intercept. 2.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and heart weight (in grams)...
1.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and...
1.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and heart weight (in grams) for 12 cats. Test at the 5% significance level that a positive linear relationship exists between the body weight of cat and their mean heart weight. Provides all parts of the test including hypotheses, test statistic, p-value, decision, and interpretation. 2.) The file cats.csv contains a data set consisting of the body weight (in kilograms) and heart weight (in grams)...
Consider a file currently consisting of 100 blocks. Assume that the File Control Block (or, the...
Consider a file currently consisting of 100 blocks. Assume that the File Control Block (or, the index block, in case of indexed allocation) is already in the RAM. Calculate how many disk I/O operations (“read block” or “write block”) are required for contiguous, linked, and indexed (single-level) allocation strategies, if the following conditions hold (In the contiguous allocation case, assume that there is no room to grow in the beginning, but there is a room to grow in the end....
Consider a file currently consisting of 200 blocks. Assume that the file control block (and the...
Consider a file currently consisting of 200 blocks. Assume that the file control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if the following conditions hold. In the contiguous allocation case, assume that there is no room to grow in the beginning, but there is room to grow in the end. Assume that the block information to...
Assignment: Create data file consisting of integer, double or String values. Create unique Java application to...
Assignment: Create data file consisting of integer, double or String values. Create unique Java application to read all data from the file echoing the data to standard output. After all data has been read, display how many data were read. For example, if 10 integers were read, the application should display all 10 integers and at the end of the output, print "10 data values were read" My issue is displaying how many integers were read and how many strings...
a) A magazine collects data each year on the price of a hamburger in a certain...
a) A magazine collects data each year on the price of a hamburger in a certain fast food restaurant in various countries around the world. The price of this hamburger for a sample of restaurants in Europe in January resulted in the following hamburger prices (after conversion to U.S. dollars). 5.16 4.95 4.09 4.66 5.28 4.69 4.12 4.96 5.15 5.55 5.34 4.60 The mean price of this hamburger in the U.S. in January was $4.61. For purposes of this exercise,...
Use the data in the Mod8-2Data file to answer the following questions. The data contains information...
Use the data in the Mod8-2Data file to answer the following questions. The data contains information from a car seat manufacturer on the age of machine (in months) and the cost of repairs (in 10s of $). Run the regression in Minitab and show the regression line on a scatter plot. Assume a level of significance of 5%. Age Repairs10 110 32.767 113 37.668 114 39.252 134 44.314 93 34.262 141 47.616 115 32.474 115 33.898 115 43.345 142 52.637...
Enter the Shoe Size and Height data from the In class data Excel file (use the...
Enter the Shoe Size and Height data from the In class data Excel file (use the excel in class data lab file loaded into the files section of Canvas) into the week 7 Regression Excel sheet. Create a scatter plot for the data, store and graph the regression equation, and note the r2 and r value. Looking at the graph and the r, and r^2 value, do you feel that shoe size is a good predictor for height? Explain your...
A magazine collects data each year on the price of a hamburger in a certain fast...
A magazine collects data each year on the price of a hamburger in a certain fast food restaurant in various countries around the world. The price of this hamburger for a sample of restaurants in Europe in January resulted in the following hamburger prices (after conversion to U.S. dollars). 5.18 4.99 4.06 4.68 5.25 4.66 4.12 4.98 5.19 5.59 5.33 4.60 The mean price of this hamburger in the U.S. in January was $4.61. For purposes of this exercise, assume...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT