Chap2. Use the data in BWGHT to answer this question.

#install.packages("wooldridge")
library(wooldridge)
data<-wooldridge::bwght
  1. Using data from 1988 for houses sold in Andover, Massachusetts, from Kiel and McClain (1995), the following equation relates housing price (price) to the distance from a recently built garbage incinerator (dist): log(price)=9.40+0.312 log(dist) n=135, R^2=0.162.
  1. Interpret the coefficient on log(dist). Is the sign of this estimate what you expect it to be? Answer: There is a positive relation between log(dist) and log(price) it means the farther you are from a garbage incinerator the more your house will sell for.
  2. Do you think simple regression provides an unbiased estimator of the ceteris paribus elasticity of price with respect to dist? (Think about the city’s decision on where to put the incinerator.) Answer: A city wouldn’t put a garbage incinerator next to a neighborhood thats already built because they know that the houses in the surrounding area would lose value. Therefore, the distance of a house to a garbage incinerator is more biased.
  3. What other factors about a house affect its price? Might these be correlated with distance from the incinerator? Answer: Other factors about price of a house besides location are how old the house is, if it’s newly updated, and how many sqft it is. Chap4. Use the data in WAGE2 to estimate a simple regression explaining monthly salary (wage) in terms of IQ score (IQ).
  4. Find the average salary and average IQ in the sample. What is the sample standard deviation of IQ? (IQ scores are standardized so that the average in the population is 100 with a standard deviation equal to 15.)
library(wooldridge)
Datanew<-wooldridge::wage2
attach(Datanew)
mean(wage)
## [1] 957.9455
mean(IQ)
## [1] 101.2824
sd(IQ)
## [1] 15.05264
modelnew<-lm(wage~IQ)
summary(Datanew)
##       wage            hours             IQ             KWW       
##  Min.   : 115.0   Min.   :20.00   Min.   : 50.0   Min.   :12.00  
##  1st Qu.: 669.0   1st Qu.:40.00   1st Qu.: 92.0   1st Qu.:31.00  
##  Median : 905.0   Median :40.00   Median :102.0   Median :37.00  
##  Mean   : 957.9   Mean   :43.93   Mean   :101.3   Mean   :35.74  
##  3rd Qu.:1160.0   3rd Qu.:48.00   3rd Qu.:112.0   3rd Qu.:41.00  
##  Max.   :3078.0   Max.   :80.00   Max.   :145.0   Max.   :56.00  
##                                                                  
##       educ           exper           tenure            age       
##  Min.   : 9.00   Min.   : 1.00   Min.   : 0.000   Min.   :28.00  
##  1st Qu.:12.00   1st Qu.: 8.00   1st Qu.: 3.000   1st Qu.:30.00  
##  Median :12.00   Median :11.00   Median : 7.000   Median :33.00  
##  Mean   :13.47   Mean   :11.56   Mean   : 7.234   Mean   :33.08  
##  3rd Qu.:16.00   3rd Qu.:15.00   3rd Qu.:11.000   3rd Qu.:36.00  
##  Max.   :18.00   Max.   :23.00   Max.   :22.000   Max.   :38.00  
##                                                                  
##     married          black            south            urban       
##  Min.   :0.000   Min.   :0.0000   Min.   :0.0000   Min.   :0.0000  
##  1st Qu.:1.000   1st Qu.:0.0000   1st Qu.:0.0000   1st Qu.:0.0000  
##  Median :1.000   Median :0.0000   Median :0.0000   Median :1.0000  
##  Mean   :0.893   Mean   :0.1283   Mean   :0.3412   Mean   :0.7176  
##  3rd Qu.:1.000   3rd Qu.:0.0000   3rd Qu.:1.0000   3rd Qu.:1.0000  
##  Max.   :1.000   Max.   :1.0000   Max.   :1.0000   Max.   :1.0000  
##                                                                    
##       sibs           brthord           meduc           feduc      
##  Min.   : 0.000   Min.   : 1.000   Min.   : 0.00   Min.   : 0.00  
##  1st Qu.: 1.000   1st Qu.: 1.000   1st Qu.: 8.00   1st Qu.: 8.00  
##  Median : 2.000   Median : 2.000   Median :12.00   Median :10.00  
##  Mean   : 2.941   Mean   : 2.277   Mean   :10.68   Mean   :10.22  
##  3rd Qu.: 4.000   3rd Qu.: 3.000   3rd Qu.:12.00   3rd Qu.:12.00  
##  Max.   :14.000   Max.   :10.000   Max.   :18.00   Max.   :18.00  
##                   NA's   :83       NA's   :78      NA's   :194    
##      lwage      
##  Min.   :4.745  
##  1st Qu.:6.506  
##  Median :6.808  
##  Mean   :6.779  
##  3rd Qu.:7.056  
##  Max.   :8.032  
## 
rm(Datanew, model1, modelnew)
## Warning in rm(Datanew, model1, modelnew): object 'model1' not found
  1. Estimate a simple regression model where a one-point increase in IQ changes wage by a constant dollar amount. Use this model to find the predicted increase in wage for an increase in IQ of 15 points. Does IQ explain most of the variation in wage?
library(wooldridge)
Data4<-wooldridge::wage2
attach(Data4)
## The following objects are masked from Datanew:
## 
##     age, black, brthord, educ, exper, feduc, hours, IQ, KWW, lwage,
##     married, meduc, sibs, south, tenure, urban, wage
mean("wage")
## Warning in mean.default("wage"): argument is not numeric or logical: returning
## NA
## [1] NA
mean("IQ")
## Warning in mean.default("IQ"): argument is not numeric or logical: returning NA
## [1] NA
sd("IQ")
## Warning in var(if (is.vector(x) || is.factor(x)) x else as.double(x), na.rm =
## na.rm): NAs introduced by coercion
## [1] NA
model<-lm(wage~IQ)
summary(model)
## 
## Call:
## lm(formula = wage ~ IQ)
## 
## Residuals:
##    Min     1Q Median     3Q    Max 
## -898.7 -256.5  -47.3  201.1 2072.6 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 116.9916    85.6415   1.366    0.172    
## IQ            8.3031     0.8364   9.927   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 384.8 on 933 degrees of freedom
## Multiple R-squared:  0.09554,    Adjusted R-squared:  0.09457 
## F-statistic: 98.55 on 1 and 933 DF,  p-value: < 2.2e-16
  1. Now, estimate a model where each one-point increase in IQ has the same percentage effect on wage. If IQ increases by 15 points, what is the approximate percentage increase in predicted wage?

Answer:An increase of IQ of 15 points will increase Wage by 124.5 points.Also, after running the command for linear regression in r-studio, we get R2=0.094. Variation in IQ explains only 9.4% of variation in Wage. Therefore, variation in IQ doesn’t explain most of the variations in Wage.