Vous êtes sur la page 1sur 3

>

> Dataset <- readXL("D:/Rank1996-2017.xlsx", rownames=FALSE, header=TRUE, na="",


+ sheet="Hoja1", stringsAsFactors=TRUE)

> # Table for Fecha:

> with(Dataset, tapply(Fecha, list(Ranking.de.la.Corrupci�n), mean, na.rm=TRUE))


102� 103� 105� 106� 110� 112� 113� 117� 118�
120�
2008.000 2014.000 2008.333 2008.000 2010.000 2017.000 2016.000 2005.000 2011.000
2009.000
122� 36� 51� 69� 71� 80� 84� 89� 99�
2004.000 1996.000 1997.000 1998.000 2000.000 1999.000 2001.000 2002.000 2015.000

> # Table for �ndice.de.Corrupci�n:

> with(Dataset, tapply(�ndice.de.Corrupci�n, list(Ranking.de.la.Corrupci�n), mean,


+ na.rm=TRUE))
102� 103� 105� 106� 110� 112� 113� 117� 118� 120� 122� 36� 51� 69� 71� 80�
84� 89� 99�
30.0 35.0 30.0 28.5 28.0 33.0 33.0 25.0 28.0 27.0 20.0 34.0 20.0 28.0 27.0 25.0
20.0 22.0 34.0

> with(Dataset, Dotplot(�ndice.de.Corrupci�n, bin=FALSE))

> with(Dataset, Dotplot(�ndice.de.Corrupci�n, bin=FALSE))

> with(Dataset, Hist(�ndice.de.Corrupci�n, scale="frequency", breaks="Sturges",


+ col="darkgray"))

> # Table for Fecha:

> with(Dataset, tapply(Fecha, list(Ranking.de.la.Corrupci�n), sd, na.rm=TRUE))


102� 103� 105� 106� 110� 112� 113� 117� 118�
120�
NA NA 3.214550 7.071068 NA NA NA NA NA
NA
122� 36� 51� 69� 71� 80� 84� 89� 99�
NA NA NA NA NA NA NA NA NA

> # Table for �ndice.de.Corrupci�n:

> with(Dataset, tapply(�ndice.de.Corrupci�n, list(Ranking.de.la.Corrupci�n), sd,


na.rm=TRUE))
102� 103� 105� 106� 110� 112� 113� 117� 118�
120�
NA NA 3.605551 7.778175 NA NA NA NA NA
NA
122� 36� 51� 69� 71� 80� 84� 89� 99�
NA NA NA NA NA NA NA NA NA

> # Table for Fecha:

> with(Dataset, tapply(Fecha, list(Ranking.de.la.Corrupci�n), IQR, na.rm=TRUE))


102� 103� 105� 106� 110� 112� 113� 117� 118� 120� 122� 36� 51� 69� 71� 80�
84� 89� 99�
0 0 3 5 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0

> # Table for �ndice.de.Corrupci�n:

> with(Dataset, tapply(�ndice.de.Corrupci�n, list(Ranking.de.la.Corrupci�n), IQR,


na.rm=TRUE))
102� 103� 105� 106� 110� 112� 113� 117� 118� 120� 122� 36� 51� 69� 71� 80�
84� 89� 99�
0.0 0.0 3.5 5.5 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0

> stripchart(�ndice.de.Corrupci�n ~ Ranking.de.la.Corrupci�n, vertical=TRUE,


method="stack",
+ ylab="�ndice.de.Corrupci�n", data=Dataset)

> editDataset(Dataset)

> RegModel.1 <- lm(Fecha~�ndice.de.Corrupci�n, data=Dataset)

> summary(RegModel.1)

Call:
lm(formula = Fecha ~ �ndice.de.Corrupci�n, data = Dataset)

Residuals:
Min 1Q Median 3Q Max
-15.4655 -0.2845 0.8103 3.4569 6.3621

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1983.3276 6.3913 310.31 < 2e-16 ***
�ndice.de.Corrupci�n 0.8276 0.2249 3.68 0.00148 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 5.138 on 20 degrees of freedom


Multiple R-squared: 0.4037, Adjusted R-squared: 0.3739
F-statistic: 13.54 on 1 and 20 DF, p-value: 0.001485

> LinearModel.2 <- lm(Fecha ~ �ndice.de.Corrupci�n, data=Dataset)

> summary(LinearModel.2)

Call:
lm(formula = Fecha ~ �ndice.de.Corrupci�n, data = Dataset)

Residuals:
Min 1Q Median 3Q Max
-15.4655 -0.2845 0.8103 3.4569 6.3621

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1983.3276 6.3913 310.31 < 2e-16 ***
�ndice.de.Corrupci�n 0.8276 0.2249 3.68 0.00148 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.138 on 20 degrees of freedom
Multiple R-squared: 0.4037, Adjusted R-squared: 0.3739
F-statistic: 13.54 on 1 and 20 DF, p-value: 0.001485

Vous aimerez peut-être aussi