The data is obtained from iHAPSS page which is an internet system for monitoring the effects of air pollution on mortality and morbidity.
## Loading required package: ggplot2
## Loading required package: AICcmodavg
Summary of data is:
summary(table)
## date dow tmean
## Min. :1987-01-01 1:26 Min. : 2.38
## 1st Qu.:1987-02-14 2:26 1st Qu.:33.75
## Median :1987-03-31 3:25 Median :45.25
## Mean :1987-03-31 4:25 Mean :49.08
## 3rd Qu.:1987-05-15 5:26 3rd Qu.:66.06
## Max. :1987-06-29 6:26 Max. :87.75
## 7:26
Plot of the data:
Some random missing is added to this data (60 values are deleted randomly in each column):
Real mean: 49.0778
Mean after adding NA: 50.5448
Easiest way to impute is to replace each missing value with the mean of the observed values for that variable. Unfortunately, this strategy can severely distort the distribution for this variable, leading to complications with summary measures including, notably, underestimates of the standard deviation. Moreover, mean imputation distorts relationships between variables by “pulling” estimates of the correlation toward zero.
Real mean: 49.0778
Mean after Mean Imputation: 50.5448
Real mean: 49.0778
Mean after LVCF Imputation: 48.709
Imputed values are hidden behind the regresssion line and partially visible in the graph.
Real mean: 49.0778
Mean after regression prediction: 49.4156
imputation is done using AMELIA: Multiple Imputation of Incomplete Multivariate Data which Runs the bootstrap EM algorithm on incomplete data and creates imputed datasets.
5 imputations are creted and the mean of the 5 samples is taken as the target.
## Loading required package: Amelia
## Loading required package: foreign
## Loading required package: Rcpp
## Loading required package: RcppArmadillo
## ##
## ## Amelia II: Multiple Imputation
## ## (Version 1.7.2, built: 2013-04-03)
## ## Copyright (C) 2005-2014 James Honaker, Gary King and Matthew Blackwell
## ## Refer to http://gking.harvard.edu/amelia/ for more information
## ##
## -- Imputation 1 --
##
## 1 2 3 4
##
## -- Imputation 2 --
##
## 1 2 3 4
##
## -- Imputation 3 --
##
## 1 2 3 4
##
## -- Imputation 4 --
##
## 1 2 3 4
##
## -- Imputation 5 --
##
## 1 2 3 4
##
## Amelia output with 5 imputed datasets.
## Return code: 1
## Message: Normal EM convergence.
##
## Chain Lengths:
## --------------
## Imputation 1: 4
## Imputation 2: 4
## Imputation 3: 4
## Imputation 4: 4
## Imputation 5: 4
##
## Rows after Listwise Deletion: 120
## Rows after Imputation: 180
## Patterns of missingness in the data: 2
##
## Fraction Missing for original variables:
## -----------------------------------------
##
## Fraction Missing
## date 0.0000
## dow 0.0000
## tmean 0.3333
Real mean: 49.0778
Mean after 5 imputations: 49.4885
Note: The actual (Q)AIC© values are not really interesting in themselves, as they depend directly on the data, parameters estimated, and likelihood function. Furthermore, a single value does not tell much about model fit. Information criteria become relevant when compared to one another for a given data set and set of candidate models.
original: 1312.8485
mean method: 1360.1213
LVCF: 1317.6132
Regression: 1239.038
Imputation: 1254.4242