Question

In: Math

Consider the data in the file Growth.csvwhich contains data on average growth rates over 1960-1995 for...

Consider the data in the file Growth.csvwhich contains data on average growth rates over 1960-1995 for 65 countries, along with variables that are potentially related to growth. A complete description of the data is given in data description which is under the name Growth- Data Description and can be found on Blackboard.

Using this data, carry out the following empirical exercises:

Construct a table that shows the sample mean, std. deviation, minimum and maximum values for the variablesGrowth, Trade-Share, YearsSchool, Oil, Rev_Coups, Assasinations, and RGDP60.

Run a regression of Growthon TradeShare, YearsSchool,Rec_Coups, Assasinations and RGDP60.Show the output of this regression in R (take a screenshot and crop the output summary in your word file that contains your answers).

What is the value on the coefficient on Rev_Coups?Is it statistically significant? Do interpretation on this coefficient.

What is the value of the adjusted R-square? Do these variables explain the majority of country growth?

Use the regression to predict the average annual growth for a country that has average values for all regressors.

Repeat (3) but now assume that the country’s value for TradeShareis one std. deviation above its mean.

Notes: Please submit through email an individual word file with your answers WELL ORGANIZEDalong with your R code (.R file) at the end.

Solutions

Expert Solution

SOLUTION:-

Here is the R-console output. R-script is given below

> # rm(list=ls())
>
> # Creating a function for obtaining a structured output for required statistics
>
> desc <- function(x){
+ m <- mean(x)
+ std <- sd(x)
+ mi <- min(x)
+ ma <- max(x)
+ out <- c(m,std,mi,ma)
+ return(out)
+ }
>
> # Aplying our function on all the columns.
> temp <- apply(df[,-1],2,desc)
> # Renaming the columns.
> rownames(temp) <- c("Mean","Standard Deviation" ,"Minimum","Maximum")
> # Now you can use "temp" or "t(temp)" for the representaion of required table.
> t(temp)
Mean Standard Deviation Minimum Maximum
growth 1.9427154 1.8971198 -2.811944 7.1568546
oil 0.0000000 0.0000000 0.000000 0.0000000
rgdp60 3103.7846487 2512.6568456 366.999939 9895.0039060
tradeshare 0.5647030 0.2892703 0.140502 1.9926157
yearsschool 3.9850769 2.5420004 0.200000 10.0699997
rev_coups 0.1674501 0.2246798 0.000000 0.9703704
assasinations 0.2775641 0.4915284 0.000000 2.4666667
>
> #Now running regression
>
> model.linear <- lm(growth~., data=df[,-c(1,3)]) #-c(1,3) will remove unwanted variables
> summary(model.linear)

Call:
lm(formula = growth ~ ., data = df[, -c(1, 3)])

Residuals:
Min 1Q Median 3Q Max
-3.6329 -0.9437 -0.0538 0.7567 5.1548

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.4897603 0.6895996 0.710 0.480372
rgdp60 -0.0004693 0.0001482 -3.167 0.002441 **
tradeshare 1.5616957 0.7579475 2.060 0.043776 *
yearsschool 0.5748461 0.1393379 4.126 0.000118 ***
rev_coups -2.1575029 1.1102915 -1.943 0.056769 .
assasinations 0.3540784 0.4773943 0.742 0.461218
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 1.582 on 59 degrees of freedom
Multiple R-squared: 0.3589, Adjusted R-squared: 0.3045
F-statistic: 6.605 on 5 and 59 DF, p-value: 6.065e-05

> # rev_coups coefficient value is -2.1575029 which is ot significant at alpha = 0.05, 0.01
> # It is significant at alpha = 0.1(90% level of significance).
>
> # Adjusted R-square is very bad it is 0.3045. We can say that these variables
> # are not explaining the growth properly.
>
> #Now working for prediction
> #We have already calculated the average/mean value for all the variables in the table temp
>
> df.pre <- temp [1,-c(1,2)]
> head(df.pre)
rgdp60 tradeshare yearsschool rev_coups assasinations
3103.7846487 0.5647030 3.9850769 0.1674501 0.2775641
>
> prediction <- predict(model.linear, newdata = data.frame(t(df.pre)))
> prediction
1
1.942715

#########################################################################################################

# rm(list=ls())

# Creating a function for obtaining a structured output for required statistics

desc <- function(x){
m <- mean(x)
std <- sd(x)
mi <- min(x)
ma <- max(x)
out <- c(m,std,mi,ma)
return(out)
}

# Aplying our function on all the columns.
temp <- apply(df[,-1],2,desc)
# Renaming the columns.
rownames(temp) <- c("Mean","Standard Deviation" ,"Minimum","Maximum")
# Now you can use "temp" or "t(temp)" for the representaion of required table.
t(temp)

#Now running regression

model.linear <- lm(growth~., data=df[,-c(1,3)]) #-c(1,3) will remove unwanted variables
summary(model.linear)
# rev_coups coefficient value is -2.1575029 which is ot significant at alpha = 0.05, 0.01
# It is significant at alpha = 0.1(90% level of significance).

# Adjusted R-square is very bad it is 0.3045. We can say that these variables
# are not explaining the growth properly.

#Now working for prediction
#We have already calculated the average/mean value for all the variables in the table temp

df.pre <- temp [1,-c(1,2)]
head(df.pre)

prediction <- predict(model.linear, newdata = data.frame(t(df.pre)))
prediction

  


Related Solutions

Average Annual Growth Rates Years Y K N z 1950-1960 3.6 3.7 1.1 1.7 1960-1970 4.3...
Average Annual Growth Rates Years Y K N z 1950-1960 3.6 3.7 1.1 1.7 1960-1970 4.3 3.9 1.8 1.8 1970-1980 3.2 3.0 2.4 .6 1980-1990 3.3 2.6 1.8 1.3 1990-2000 3.5 2.4 1.4 1.7 2000-2009 1.4 2.1 .2 .7 2010-2014 2.1 .9 .9 1.1 a) Relate K to z. Discuss how they should be related theoretically and how they appear to be related empirically (numbers in the table). b) Relate K to Y. Discuss how they should be related theoretically...
Consider a text file that you will create named “employees.txt”. The file contains data organized according...
Consider a text file that you will create named “employees.txt”. The file contains data organized according to the following format:John Smith 10 15Sarah Johnson 40 12Mary Taylor 27 13Jim Stewart 25 8For instance, “John” is the first name, “Smith” is the last name, “10” is the number of hours per week, and “15” is the hourly rate.Write a program that computes the weekly salary of each employee. The program prints the first name, last name, and weekly salary of each...
PotashCorp The data set in the file ch18_MCSP_PotashCorp contains average quarterly share prices for PotashCorp and...
PotashCorp The data set in the file ch18_MCSP_PotashCorp contains average quarterly share prices for PotashCorp and prices for potash mineral. Investigate the relationship between these variables. (a) Some people think that if the share price of a mining company is high, that is because investors expect high mineral prices for thecorresponding quarter. Can the potash price be estimated from the PotashCorp share price? The data includes a period when the price of potash mineral was exceptionally high. If you eliminate...
If the file circuit.txt contains the following data
Exercise 2: If the file circuit.txt contains the following data 3.0             2.1 1.5             1.1 2.6             4.1 The first column is voltage and the second column is the electric current. Write program that reads the voltages and currents then calculates the electric power (P) based on the equation: Voltage     Current        Power 3.0             2.1              (result) 1.5             1.1              (result) 2.6             4.1              (result)                         P = v * i Write your output to the file results.txt with voltage in the first, current in the second...
The data file wages contains monthly values of the average hourly wages (in dol-lars) for workers...
The data file wages contains monthly values of the average hourly wages (in dol-lars) for workers in the U.S. apparel and textile products industry for July 1981 through June 1987. (a) Display and interpret the time series plot for these data. (b) Use least squares to fit a linear time trend to this time series. Interpret the regression output. Save the standardized residuals from the fit for further analysis. (c) Construct and interpret the time series plot of the standardized...
Statistics Canada reports the following annual average rates of growth over each of three periods:                          &nbs
Statistics Canada reports the following annual average rates of growth over each of three periods:                                     1961-1980       1980-2000       2000-2011 real GDP (Y)               5.0%                3.2%                1.7% labour (N)                   2.9%                2.2%                1.3% capital (K)                   5.7%                3.9%                3.4%                 It has been estimated that the elasticity of output with respect to capital is αk= 0.34 and the elasticity of output with respect to labour is αn= 0.66.                                     1961-1980       1980-2000       2000-2011 real GDP                     5.0%                3.2%                1.7% labour                          1.914%           1.452%            0.858% capital                         1.938%            1.326%            1.156% productivity                1.148%            0.42%              -0.31% QQQQ Write, in your own words and based on the table you have filled up in question 2 above, a super-short history of...
Below are data for countries with fast and slow growth rates over two different time periods....
Below are data for countries with fast and slow growth rates over two different time periods. Construct a bar chart for each country in both categories. In other words, you will end up with four different bar charts, two for each of the two categories of the countries representing both time periods. Country Average Growth Rate of Real GDP 1990–2000 Average Growth Rate of Real GDP 2000–2008 Fast Growth Club (5% or more per year in both time periods) Cambodia...
Analyze unemployment and inflation data for the (1950's-1960's) as to their relation to output and growth....
Analyze unemployment and inflation data for the (1950's-1960's) as to their relation to output and growth. explain how inflation and unemployment are calculated for the data presented. Discuss how changes in both are related to changes in GDP growth.
Assume there is a file called "mydata". each line of the file contains two data items
how do you read in a file in JAVA Assume there is a file called "mydata". each line of the file contains two data items: hours and rate. hours is the represented by the number of hours the worker worked and rate is represented as hourly rate of pay. The first item of data is count indicating how many lines of data are to follow.Methodspay- accepts the number of hours worked and the rate of pay. returns the dollor and cents...
The data file contains displacement (in mm)-load (in N) data for a mechanical test that was...
The data file contains displacement (in mm)-load (in N) data for a mechanical test that was conducted on an unknown metal. The initial length and diameter of the specimen are also given. a. (5 pts.) Using the data and a computer program (such as Excel), create an engineering stress-engineering strain graph with proper labels. The stress axis should be in the units of MPa. You do not need to show your spreadsheet or software code used to make the graph....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT