You are on page 1of 4

dmba proj

Himanshu Gupta

March 27, 2017

R Markdown
This is an R Markdown document. Markdown is a simple formatting syntax for authoring
HTML, PDF, and MS Word documents. For more details on using R Markdown see
http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as
well as the output of any embedded R code chunks within the document. You can embed an
R code chunk like this:
summary(cars)

## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00

Including Plots
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the code chunk to prevent printing of
the R code that generated the plot.
d<-read.csv("nrhm.csv", sep = ",", header=T)
summary(d)

## State Mothers.registered Children.immunized


## : 1 Min. : 7.10 Min. : 6.95
## Andaman and Nicobar Islands : 1 1st Qu.:10.57 1st Qu.: 9.83
## Andhra Pradesh and Telangana: 1 Median :12.97 Median :12.55
## Arunachal Pradesh : 1 Mean :12.25 Mean :11.87
## Assam : 1 3rd Qu.:13.98 3rd Qu.:13.84
## Bihar : 1 Max. :15.53 Max. :15.34
## (Other) :29 NA's :1 NA's :1
## No..of.ASHA No..of.ANM No..of.subcentres No..of.doctors
## Min. : 0.000 Min. :2.940 Min. : 2.890 Min. :0.000
## 1st Qu.: 7.050 1st Qu.:5.013 1st Qu.: 6.090 1st Qu.:4.178
## Median : 9.525 Median :6.310 Median : 8.025 Median :6.005
## Mean : 8.326 Mean :6.391 Mean : 7.341 Mean :5.485
## 3rd Qu.:10.665 3rd Qu.:8.172 3rd Qu.: 9.238 3rd Qu.:7.022
## Max. :11.820 Max. :9.280 Max. :10.120 Max. :7.990
## NA's :1 NA's :1 NA's :1 NA's :1
## No..of.nurses Percentage.of.Urbanization X..of.SC.pop.
## Min. : 4.780 Min. :10.04 Min. : 0.00
## 1st Qu.: 7.662 1st Qu.:24.26 1st Qu.: 4.00
## Median : 9.845 Median :31.22 Median : 14.20
## Mean : 9.169 Mean :37.06 Mean : 72.32
## 3rd Qu.:10.870 3rd Qu.:46.27 3rd Qu.: 18.88
## Max. :12.030 Max. :97.25 Max. :2011.00
## NA's :1 NA's :1 NA's :1
## X..of.ST.pop. Per.capita.income Litreacy.rate
## Min. : 0.000 Min. :12012 Min. :61.80
## 1st Qu.: 5.725 1st Qu.:25104 1st Qu.:70.76
## Median : 12.150 Median :39308 Median :76.60
## Mean : 82.911 Mean :40626 Mean :77.61
## 3rd Qu.: 33.300 3rd Qu.:48056 3rd Qu.:85.09
## Max. :2011.000 Max. :94885 Max. :94.00
## NA's :1 NA's :1 NA's :1

mod1<-
lm(d$Children.immunized~d$No..of.ASHA+d$No..of.ANM+d$No..of.subcentres+d$No..
of.doctors+d$No..of.nurses+d$Litreacy.rate+d$Percentage.of.Urbanization)
summary(mod1)

##
## Call:
## lm(formula = d$Children.immunized ~ d$No..of.ASHA + d$No..of.ANM +
## d$No..of.subcentres + d$No..of.doctors + d$No..of.nurses +
## d$Litreacy.rate + d$Percentage.of.Urbanization)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.68477 -0.23812 0.08576 0.20978 0.70653
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 3.036589 1.272560 2.386 0.024592 *
## d$No..of.ASHA -0.248561 0.087603 -2.837 0.008702 **
## d$No..of.ANM 0.163980 0.083884 1.955 0.061433 .
## d$No..of.subcentres 0.950763 0.219101 4.339 0.000192 ***
## d$No..of.doctors -0.257893 0.133251 -1.935 0.063888 .
## d$No..of.nurses 0.571960 0.240158 2.382 0.024845 *
## d$Litreacy.rate -0.020031 0.013073 -1.532 0.137541
## d$Percentage.of.Urbanization 0.016109 0.006718 2.398 0.023965 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3919 on 26 degrees of freedom
## (1 observation deleted due to missingness)
## Multiple R-squared: 0.9761, Adjusted R-squared: 0.9697
## F-statistic: 151.7 on 7 and 26 DF, p-value: < 2.2e-16

library(car)

## Warning: package 'car' was built under R version 3.3.3

vif(mod1)
## d$No..of.ASHA d$No..of.ANM
## 17.965258 5.134019
## d$No..of.subcentres d$No..of.doctors
## 46.924003 15.885448
## d$No..of.nurses d$Litreacy.rate
## 58.675563 2.714011
## d$Percentage.of.Urbanization
## 3.884021

You might also like