logo

Model parameter are tested for statistical

14 Pages3949 Words14 Views
   

Added on  2022-09-13

Model parameter are tested for statistical

   Added on 2022-09-13

ShareRelated Documents
Data Analysis in R
Name
Course Name
4 - APR - 2020
Faculty Name
Model parameter are tested for statistical_1
Question 1
# Philip's curve
table6_5 <- read.csv('table6_5.csv')
table6_5$inf_chg[1] = NA
# calculate change in inflation rate -------------------------------
for(i in 2:nrow(table6_5)){
table6_5$inf_chg[i] = table6_5$INFLRATE[i]-table6_5$INFLRATE[i-1]
}
# Reproducing figure 6.9 -----------------------------------------
with(table6_5,
plot(UNRATE, inf_chg,
xlab = "Unemployment rate (%)",
ylab = "Change in inflation rate", lwd = 3))
abline(h = 0, lty = 'longdash', lwd = 2)
# linear Model 6.7.5 ---------------------------------------------
lm6_7_5 <- lm(inf_chg ~ UNRATE, data = table6_5)
summary(lm6_7_5)
-Call:
-lm(formula = inf_chg ~ UNRATE, data = table6_5)
-
-Residuals:
- Min 1Q Median 3Q Max
--2.2343 -0.9166 -0.2416 0.2638 4.6069
Model parameter are tested for statistical_2
-Coefficients:
- Estimate Std. Error t value Pr(>|t|)
-(Intercept) 3.7844 0.9030 4.191 0.000132 ***
-UNRATE -0.6385 0.1493 -4.276 0.000101 ***
----
-Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-
-Residual standard error: 1.445 on 44 degrees of freedom
- (1 observation deleted due to missingness)
-Multiple R-squared: 0.2935, Adjusted R-squared: 0.2775
-F-statistic: 18.28 on 1 and 44 DF, p-value: 0.0001009#Reciprocal model 6.7,6 ---------------------------------------
table6_5$rec_unrate <- with(table6_5, 1/UNRATE)
rec6_7_6 <- lm(inf_chg ~ rec_unrate, data = table6_5)
summary(rec6_7_6)
-
-Call:
-lm(formula = inf_chg ~ rec_unrate, data = table6_5)
-
-Residuals:
- Min 1Q Median 3Q Max
--2.8606 -1.0349 -0.1948 0.4836 4.8115
-
-Coefficients:
- Estimate Std. Error t value Pr(>|t|)
-(Intercept) -3.0683 0.9699 -3.163 0.00283 **
-rec_unrate 17.2075 5.2326 3.289 0.00199 **
----
-Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-
-Residual standard error: 1.54 on 44 degrees of freedom
- (1 observation deleted due to missingness)
-Multiple R-squared: 0.1973, Adjusted R-squared: 0.1791
-F-statistic: 10.81 on 1 and 44 DF, p-value: 0.001986# Natural Unemployment rate 6.7.7 ----------------------------
U_N <- c(lm6_7_5$coefficients[1]/(-lm6_7_5$coefficients[2]))
names(U_N) <- 'natural unemployment rate'
Question 3
table6_10 <- read.csv('table6_10.csv')
#model 1 --------------------------------------
mod_1 <- lm(Exp ~ Adexp, data = table6_10)
summary(mod_1)
-Call:
-lm(formula = Exp ~ Adexp, data = table6_10)
-
Model parameter are tested for statistical_3
-Residuals:
- Min 1Q Median 3Q Max
--4444.5 -1390.8 -968.9 -199.1 8618.6
-
-Coefficients:
- Estimate Std. Error t value Pr(>|t|)
-(Intercept) 1.057e+03 5.959e+02 1.774 0.0873 .
-Adexp 4.460e-02 7.099e-03 6.283 1.01e-06 ***
-Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-
-Residual standard error: 2915 on 27 degrees of freedom
-Multiple R-squared: 0.5938, Adjusted R-squared: 0.5788
-F-statistic: 39.47 on 1 and 27 DF, p-value: 1.008e-06#model 2 ---------------------------------------
mod_2 <- lm(LNExp ~ LNAdexp, data = table6_10)
summary(mod_2)
-
-Call:
-lm(formula = LNExp ~ LNAdexp, data = table6_10)
-
-Residuals:
- Min 1Q Median 3Q Max
--2.2162 -0.9762 -0.3155 1.2048 2.5228
-
-Coefficients:
- Estimate Std. Error t value Pr(>|t|)
-(Intercept) 0.9864 1.5702 0.628 0.53517
-LNAdexp 0.6038 0.1658 3.642 0.00113 **
-Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
-
-Residual standard error: 1.358 on 27 degrees of freedom
-Multiple R-squared: 0.3294, Adjusted R-squared: 0.3046
-F-statistic: 13.26 on 1 and 27 DF, p-value: 0.001132#model 3 ------------------------------------------------
mod_3 <- lm(Exp_inverse ~ Adexp_inverse, data = table6_10)
summary(mod_3)
-
-Call:
-lm(formula = Exp_inverse ~ Adexp_inverse, data = table6_10)
-
-Residuals:
- Min 1Q Median 3Q Max
--0.003370 -0.002774 -0.001858 0.001104 0.008824
-
-Coefficients:
Model parameter are tested for statistical_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Model 1 Call: lm(formula = age ~ proportion.black) Residuals:
|2
|151
|260

Frequency Analysis of Regenerate Vegetative or by Seed and Cross-Classified Plant Species
|9
|1580
|251

Research on Microorganisms | Study
|16
|2055
|294

Data Analysis: Assignment
|16
|2057
|325

Data Analysis Project for Desklib
|9
|2087
|218

Linear Regression and Correlation Analysis Assignment
|13
|1372
|109