ANALISIS FIGURA 4E

Importando datos de puntos

db <- read.csv("~/Downloads/ComiteEtica/ComiteEtica_db.csv")
knitr::kable(db)
Point Type Location Value
1 Marker 910.0 0.00
2 Marker 621.5 100.00
3 Marker 331.5 200.00
4 Marker 39.5 300.00
5 RiseNif 457.5 156.27
6 RiseNif 401.5 175.56
7 RiseHET 595.5 108.71
8 RiseHET 571.5 116.98
9 RiseHET 497.5 142.48
10 DropRise 245.5 229.32
11 DropRise 221.5 237.59
12 DropRise 161.5 258.27
13 DropHET 199.5 245.17
14 DropHET 163.5 257.58
15 DropGsMT 241.5 230.70
16 DropGsMT 209.5 241.73
17 DropGsMT 227.5 235.52
18 DropGsMT 165.5 256.89
19 DropGsMT 93.5 281.70

Formato columnas data base

Extriago datos de los valures calculados de los puntos

db1 <- db[(5:nrow(db)),]
db1$Type <- factor(db1$Type, levels = c("RiseNif", "RiseHET", "DropRise", "DropHET", "DropGsMT"))

Grafico de barras con +/- 2 DESVIACIONES ESTANDAR

1. Obteniendo datos de Media, SD y SE

library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
res <- db1 %>%                # tomo la base de datos
  group_by(Type) %>%          # la agrupo por la variable tipo
  summarise(
    size = mean(Value),       # Promedio por grupo
    sd = sd(Value),           # desviacion estandar por grupo
    n = n(),                  # n por grupo (cross check)
    se = sd / sqrt(n)         # error estandar
  )
res
## # A tibble: 5 × 5
##   Type      size    sd     n    se
##   <fct>    <dbl> <dbl> <int> <dbl>
## 1 RiseNif   166. 13.6      2  9.64
## 2 RiseHET   123. 17.6      3 10.2 
## 3 DropRise  242. 14.9      3  8.61
## 4 DropHET   251.  8.78     2  6.20
## 5 DropGsMT  249. 20.6      5  9.22

2. Grafica

library(ggplot2)
ggplot(res, aes(x=Type, y=size, fill=Type)) + 
  #geom_bar(stat="identity", color="black", position=position_dodge()) +
  geom_point(data = db1, aes(x=Type, y=Value, col = Type)) +
  geom_errorbar(aes(ymin=size-2*sd, ymax=size+2*sd), width=.2,
                 position=position_dodge(.9)) +
  ylim(0, 300)