Professional Documents
Culture Documents
Himanshu Gupta
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)
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)
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