# Load data (panel data)
data('RiceFarms', package = 'plm')
stargazer(RiceFarms, type = 'text', title = ' Table 1: Data Summary Statistics')
##
## Table 1: Data Summary Statistics
## ========================================================
## Statistic N Mean St. Dev. Min Max
## --------------------------------------------------------
## id 1,026 374,954.100 164,378.900 101,001 609,245
## size 1,026 0.432 0.547 0.010 5.322
## seed 1,026 18.206 45.251 1 1,250
## urea 1,026 95.441 127.149 1 1,250
## phosphate 1,026 33.728 47.588 0 700
## pesticide 1,026 595.005 2,927.581 0 62,600
## pseed 1,026 112.072 64.280 40.000 375.000
## purea 1,026 78.980 8.674 50.000 100.000
## pphosph 1,026 79.568 9.272 60.000 120.000
## hiredlabor 1,026 237.023 422.233 1 4,536
## famlabor 1,026 151.470 148.116 1 1,526
## totlabor 1,026 388.447 484.204 17 4,774
## wage 1,026 80.423 42.189 30.000 175.350
## goutput 1,026 1,405.167 1,921.757 42 20,960
## noutput 1,026 1,240.920 1,638.983 42 17,610
## price 1,026 90.961 37.495 50.000 190.000
## --------------------------------------------------------
Comments: Data contains no missing values. However, it may suffer from outliers in some variables.
Objective:
Regression Equation:
# Multi-linear Model
mlr <- lm(goutput ~ phosphate +
pphosph+
size +
seed +
varieties +
wage +
totlabor +
factor(region),
data = RiceFarms
)
stargazer(mlr, type = 'text')
##
## =====================================================
## Dependent variable:
## ---------------------------
## goutput
## -----------------------------------------------------
## phosphate 10.296***
## (0.612)
##
## pphosph 1.841
## (3.791)
##
## size 1,714.079***
## (109.906)
##
## seed 0.930
## (0.594)
##
## varietieshigh 203.785***
## (77.325)
##
## varietiesmixed -109.855
## (104.478)
##
## wage 2.498***
## (0.849)
##
## totlabor 0.981***
## (0.110)
##
## factor(region)langan 141.568*
## (84.964)
##
## factor(region)gunungwangi -45.203
## (102.699)
##
## factor(region)malausma -52.304
## (104.870)
##
## factor(region)sukaambit 11.254
## (99.470)
##
## factor(region)ciwangi 127.068
## (105.914)
##
## Constant -508.665**
## (257.105)
##
## -----------------------------------------------------
## Observations 1,026
## R2 0.878
## Adjusted R2 0.877
## Residual Std. Error 674.987 (df = 1012)
## F Statistic 561.280*** (df = 13; 1012)
## =====================================================
## Note: *p<0.1; **p<0.05; ***p<0.01
Comments: Interpretation of the coefficients are the following and only coefficients that are statistically significant will be interpreted.
# plot residual graphs
par(mfrow = c(2, 2))
plot(mlr)
Comments:
Linearity: the parameters we are estimating using the OLS method must be themselves linear.
Random: our data must have been randomly sampled from the population.
Non-Collinearity: the regressors being calculated aren’t perfectly correlated with each other.
Homoscedasticity: no matter what the values of our regressors might be, the error of the variance is constant.