Data meets presentation

Rafael Resendiz

[1] "Tue Nov 25 21:33:56 2014"

Reproducible Pitch Presentation

1. Knowing “Data meets presentation”

2. Statistical inference and simulation

3. Data basic plot

* Hiperlink a Rpubs (http://rpubs.com/Rafael-Resendiz/RPP)

1. Knowing “Data meets presentation”

Load files and datasets and and have fun with them

data(iris)  # Load data
lm(iris)    # Make a lineal regression

Call:
lm(formula = iris)

Coefficients:
      (Intercept)        Sepal.Width       Petal.Length  
           2.1713             0.4959             0.8292  
      Petal.Width  Speciesversicolor   Speciesvirginica  
          -0.3152            -0.7236            -1.0235  

2. Statistical inference and simulation

Setting the global options Example: The exponential distribution

lambda = 0.2    # lambda for simulations
n = 20          # number of exponential random variables
nsims = 1:100   # number of simulated averages
set.seed(1)
means <- data.frame(x=sapply(nsims,function(x) {mean(rexp(n,lambda))})) # necessary means
# head(means,1)  # Show the results
str(means)     # Summary of the results
'data.frame':   100 obs. of  1 variable:
 $ x: num  5.45 4.27 5.17 6.76 4.12 ...

Statistical inference in the real life

fit <- lm(iris)   # Work with real data
confint(fit)      # Identify intercepts
                       2.5 %      97.5 %
(Intercept)        1.6182321  2.72430044
Sepal.Width        0.3257653  0.66601260
Petal.Length       0.6937939  0.96469395
Petal.Width       -0.6140049 -0.01630542
Speciesversicolor -1.1982739 -0.24885002
Speciesvirginica  -1.6831329 -0.36386273
summary(fit$residuals)
     Min.   1st Qu.    Median      Mean   3rd Qu.      Max. 
-0.794200 -0.218700  0.008987  0.000000  0.202500  0.731000 

Data basic plot

Normal distribution

plot of chunk unnamed-chunk-5

Data basic plot

Plot your results and identify your creativity plot of chunk unnamed-chunk-6