Importação dos pacotes

#-----------------------------------------------------------------------
# Carrega os pacotes.

# library(nFactors)
library(gridExtra)
library(tidyverse)

Experimento 1

Leitura do arquivo de dados

#-----------------------------------------------------------------------
# Informações sobre os arquivos de dados.

# BASE_EXPERIMENTO 1.txt -----------------------------------------------
# TM: acertou ou errou a tarefa de esgotamento.
# D_*: são as decisões (0 ou 1).
# C_*: nível de confiança das decisões.
# BI_*: respostas para questões de business impusiviness.
# EAC_*: respostas para questões de escala de autocontrole.
# OE_*: orçamento empresarial.
# VI_*: verificação das intruções.

#-----------------------------------------------------------------------

# Exibe o conteúdo do diretório de trabalho.
dir()
## [1] "analise.html"            "analise.R"              
## [3] "analise.Rmd"             "BASE_EXPERIMENTO 1.txt" 
## [5] "BASE_EXPERIMENTO 1.xlsx" "BASE_EXPERIMENTO 2.txt" 
## [7] "BASE_EXPERIMENTO 2.xlsx"
# Importa a base de dados.
da <- read_tsv("BASE_EXPERIMENTO 1.txt")
## Parsed with column specification:
## cols(
##   .default = col_integer(),
##   Participantes = col_character()
## )
## See spec(...) for full column specifications.
attr(da, "spec") <- NULL
str(da)
## Classes 'tbl_df', 'tbl' and 'data.frame':    94 obs. of  152 variables:
##  $ Participantes: chr  "A01" "A02" "A03" "A04" ...
##  $ TM           : int  1 0 1 0 1 1 1 1 1 0 ...
##  $ D_1          : int  0 0 1 0 0 1 1 0 0 0 ...
##  $ D_2          : int  1 0 1 1 1 1 1 0 1 1 ...
##  $ D_3          : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_4          : int  1 1 1 1 1 1 1 0 0 1 ...
##  $ D_5          : int  1 1 1 0 1 1 1 0 1 1 ...
##  $ D_6          : int  0 1 1 1 0 1 1 0 0 1 ...
##  $ D_7          : int  1 1 1 1 0 0 1 0 0 1 ...
##  $ D_8          : int  1 1 0 1 0 0 1 0 1 1 ...
##  $ D_9          : int  1 0 0 1 1 1 1 0 1 1 ...
##  $ D_10         : int  1 1 1 1 0 1 1 0 1 1 ...
##  $ D_11         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_12         : int  1 1 1 1 1 1 1 0 1 1 ...
##  $ D_13         : int  0 0 1 1 0 0 1 0 0 1 ...
##  $ D_14         : int  0 1 0 1 0 0 1 0 1 0 ...
##  $ D_15         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_16         : int  1 0 0 1 1 1 1 0 1 0 ...
##  $ D_17         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_18         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_19         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_20         : int  1 1 0 1 0 1 1 0 0 1 ...
##  $ D_21         : int  1 1 0 1 0 0 1 0 1 1 ...
##  $ D_22         : int  1 1 0 1 0 1 1 0 1 0 ...
##  $ D_23         : int  1 1 0 1 1 1 1 0 1 0 ...
##  $ D_24         : int  1 1 0 1 1 1 1 0 1 1 ...
##  $ D_25         : int  1 1 0 0 1 1 1 0 1 1 ...
##  $ D_26         : int  1 1 0 1 0 0 1 0 1 1 ...
##  $ D_27         : int  1 1 0 1 0 1 1 0 1 0 ...
##  $ D_28         : int  0 0 0 0 0 0 1 0 1 1 ...
##  $ D_29         : int  1 1 0 0 1 1 1 0 1 1 ...
##  $ D_30         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_31         : int  1 1 1 1 0 1 1 0 1 1 ...
##  $ D_32         : int  1 1 0 1 1 1 1 0 1 1 ...
##  $ D_33         : int  0 0 0 1 0 0 1 0 1 1 ...
##  $ D_34         : int  0 1 1 1 0 0 1 0 1 1 ...
##  $ D_35         : int  1 1 0 1 0 1 1 0 1 1 ...
##  $ D_36         : int  1 1 0 1 1 1 1 0 0 1 ...
##  $ D_37         : int  1 1 1 1 0 1 1 0 1 0 ...
##  $ D_38         : int  1 1 1 1 0 1 1 0 1 0 ...
##  $ D_39         : int  1 1 1 1 0 1 1 0 1 0 ...
##  $ D_40         : int  1 1 0 1 0 1 1 0 0 0 ...
##  $ C_1          : int  8 8 10 10 10 6 8 9 8 8 ...
##  $ C_2          : int  7 9 9 10 8 8 9 8 7 8 ...
##  $ C_3          : int  6 9 10 9 8 8 8 7 7 8 ...
##  $ C_4          : int  6 7 10 7 8 8 7 7 7 9 ...
##  $ C_5          : int  8 7 9 8 10 7 8 8 8 9 ...
##  $ C_6          : int  6 7 10 9 9 7 8 8 8 8 ...
##  $ C_7          : int  8 7 9 10 9 7 8 8 7 8 ...
##  $ C_8          : int  9 7 10 10 10 6 8 8 8 8 ...
##  $ C_9          : int  7 7 8 6 8 8 8 8 8 9 ...
##  $ C_10         : int  8 8 9 10 10 6 8 8 8 9 ...
##  $ C_11         : int  7 7 9 8 8 6 8 8 7 8 ...
##  $ C_12         : int  6 7 10 9 9 9 9 8 7 8 ...
##  $ C_13         : int  9 8 9 10 9 7 8 8 8 9 ...
##  $ C_14         : int  7 8 10 10 8 6 8 8 8 8 ...
##  $ C_15         : int  7 8 10 8 8 7 8 8 8 9 ...
##  $ C_16         : int  9 7 8 10 7 9 8 8 7 9 ...
##  $ C_17         : int  7 7 9 10 8 6 8 8 7 9 ...
##  $ C_18         : int  6 6 8 10 8 7 8 8 7 9 ...
##  $ C_19         : int  6 6 9 10 7 7 8 8 7 9 ...
##  $ C_20         : int  7 10 8 10 6 9 8 8 7 9 ...
##  $ C_21         : int  7 8 8 7 7 6 8 8 6 8 ...
##  $ C_22         : int  9 7 9 10 9 7 8 8 8 9 ...
##  $ C_23         : int  7 8 9 10 6 8 8 8 7 8 ...
##  $ C_24         : int  7 7 8 8 8 7 8 8 7 7 ...
##  $ C_25         : int  6 9 10 10 8 7 8 8 7 9 ...
##  $ C_26         : int  7 9 8 7 7 6 8 8 7 9 ...
##  $ C_27         : int  8 8 10 7 7 8 8 8 7 7 ...
##  $ C_28         : int  9 7 9 10 8 7 8 8 8 8 ...
##  $ C_29         : int  6 6 9 10 6 8 8 8 8 8 ...
##  $ C_30         : int  8 7 8 8 6 7 8 8 8 8 ...
##  $ C_31         : int  7 8 9 1 7 7 8 8 8 8 ...
##  $ C_32         : int  8 7 10 9 8 8 8 8 8 8 ...
##  $ C_33         : int  7 6 8 8 8 7 8 8 7 9 ...
##  $ C_34         : int  7 8 9 10 6 7 8 8 7 9 ...
##  $ C_35         : int  9 8 10 8 7 7 8 8 7 8 ...
##  $ C_36         : int  7 7 8 10 8 8 8 8 6 9 ...
##  $ C_37         : int  8 7 9 10 7 6 8 8 7 8 ...
##  $ C_38         : int  7 6 10 10 7 7 8 8 7 8 ...
##  $ C_39         : int  8 8 9 7 8 7 8 8 7 9 ...
##  $ C_40         : int  9 9 8 9 9 8 8 8 7 7 ...
##  $ BI_1         : int  3 3 4 3 4 4 4 3 3 3 ...
##  $ BI_2         : int  2 2 2 2 2 1 1 1 1 4 ...
##  $ BI_3         : int  1 2 3 2 4 1 2 2 1 2 ...
##  $ BI_4         : int  2 1 1 1 3 1 1 1 1 2 ...
##  $ BI_5         : int  4 2 2 2 2 1 1 1 2 2 ...
##  $ BI_6         : int  4 2 3 4 4 4 2 2 4 1 ...
##  $ BI_7         : int  3 3 4 3 2 3 4 4 4 1 ...
##  $ BI_8         : int  4 3 3 4 4 1 3 3 3 1 ...
##  $ BI_9         : int  1 2 3 4 4 2 2 4 1 2 ...
##  $ BI_10        : int  3 4 3 1 4 4 3 3 4 2 ...
##  $ BI_11        : int  4 1 1 4 2 3 1 1 1 2 ...
##  $ BI_12        : int  3 3 4 4 3 3 4 4 4 2 ...
##  $ BI_13        : int  4 4 4 4 4 4 4 4 3 3 ...
##  $ BI_14        : int  3 1 1 1 4 2 1 1 2 2 ...
##  $ BI_15        : int  1 3 4 4 4 1 2 3 3 3 ...
##  $ BI_16        : int  1 1 2 1 1 1 1 1 2 1 ...
##  $ BI_17        : int  2 2 4 1 1 2 1 1 1 3 ...
##   [list output truncated]
# Criar o tratamento de autocontrole.
da$autocon <- da$Participantes %>%
    substr(start = 0, stop = 1) %>%
    as.factor()

#-----------------------------------------------------------------------
# Tabela que associa os nomes das questões que são as mesmas.

# Correspondência entre as decisões.
decis <- matrix(data = sprintf("%02d", 1:40), ncol = 2)

# Renomeia os números para ter dois digitos, então 1 fica 01.
names(da) <- names(da) %>%
    str_replace(pattern = "(.*)(_)(\\d)$",
                replacement = "\\1\\20\\3")

Análise de componentes principais

As variáveis de BI foram medidas para quantificar as diferenças sobre a impulsividade entre os participantes. Imagina-se que as respostas para as questões de BI possam ser explicadas por um conjunto pequeno de fatores latentes. O mesmo para OE e EAC. Para determinar o índice de impulsividade individual, será feita a análise de componentes principais com as respostas do questionário de BI. O número de componentes ideal a ser usado na análise de regressão será determinado depois.

Business impulsiviness

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis BI_*.

# Extrai e cria uma matriz com as variáveis de BI_*.
X <- da %>%
    select(contains("BI"))
dim(X)
## [1] 94 30
bi_basica <- X %>%
    gather(key = "BI", value = "valor") %>%
    group_by(BI) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(BI = str_replace(BI, "BI_", ""))

bi_basica %>%
    print(n = Inf)
## # A tibble: 30 x 7
##    BI        n média mediana desvpad mínimo máximo
##    <chr> <int> <dbl>   <dbl>   <dbl>  <dbl>  <dbl>
##  1 01       94  3.07       3   0.779      1      4
##  2 02       94  1.86       2   0.798      1      4
##  3 03       94  2.27       2   0.845      1      4
##  4 04       94  1.60       1   0.780      1      4
##  5 05       94  1.79       2   0.731      1      4
##  6 06       94  2.45       2   1.03       1      4
##  7 07       94  2.80       3   1.06       1      4
##  8 08       94  3.07       3   0.765      1      4
##  9 09       94  2.53       2   0.799      1      4
## 10 10       94  2.79       3   1.13       1      4
## 11 11       94  1.94       2   0.959      1      4
## 12 12       94  3.10       3   0.734      1      4
## 13 13       94  3.44       4   0.862      1      4
## 14 14       94  1.94       2   0.759      1      4
## 15 15       94  2.87       3   0.964      1      4
## 16 16       94  1.56       1   0.770      1      4
## 17 17       94  1.85       2   0.775      1      4
## 18 18       94  2.05       2   0.860      1      4
## 19 19       94  1.89       2   0.823      1      4
## 20 20       94  2.76       3   0.758      1      4
## 21 21       94  1.35       1   0.813      1      4
## 22 22       94  1.97       2   0.989      1      4
## 23 23       94  2.09       2   0.969      1      4
## 24 24       94  1.91       2   0.851      1      4
## 25 25       94  1.32       1   0.707      1      4
## 26 26       94  2.90       3   0.928      1      4
## 27 27       94  2.24       2   0.838      1      4
## 28 28       94  2.28       2   0.966      1      4
## 29 29       94  3.04       3   0.961      1      4
## 30 30       94  3.22       3   0.750      1      4
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(bi_basica, aes(x = BI, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Business impulsiviness") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 94 30
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("BI_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10
## 29        -0.25                -0.20                        0.57   0.33  
## 21                             -0.24  -0.41                              
## 01  0.28                                      0.30                       
## 02 -0.29                                                                 
## 03        -0.27                       -0.49                       -0.41  
## 04 -0.26                                            -0.20                
## 05 -0.24                 0.25                                      0.21  
## 06                             -0.26                -0.33                
## 07                                                  -0.25                
## 08                             -0.44         -0.23         -0.20         
## 09        -0.28                -0.23                       -0.29         
## 10  0.23         -0.25                              -0.32                
## 11                      -0.25  -0.37          0.33   0.31                
## 12  0.25          0.25                 0.23                              
## 13                      -0.23         -0.21  -0.27          0.31         
## 14 -0.27                                            -0.25                
## 15        -0.32   0.20   0.29          0.25                       -0.24  
## 16                       0.49                                            
## 17 -0.24                                      0.29                       
## 18 -0.20   0.36                                            -0.30         
## 19        -0.28                               0.39                       
## 20        -0.26                -0.25                       -0.30   0.29  
## 22                0.36          0.22                                     
## 23                       0.46                       -0.27                
## 24                0.37                                      0.28  -0.36  
## 25                0.45                       -0.28   0.25                
## 26                0.21  -0.23  -0.21   0.37         -0.29                
## 27        -0.26                              -0.22                -0.38  
## 28         0.24                -0.36                 0.25                
## 30  0.25          0.27                        0.20                       
##    Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17 Comp.18 Comp.19
## 29                                         -0.35                          
## 21          0.37    0.62                            0.22                  
## 01         -0.41                                                          
## 02 -0.27                                    0.25    0.21   -0.25          
## 03  0.27   -0.28                                                          
## 04  0.31                           -0.24           -0.34                  
## 05         -0.27                    0.22           -0.34                  
## 06                         -0.30    0.29            0.24                  
## 07  0.34           -0.27    0.40                           -0.30          
## 08 -0.27                    0.38                   -0.28                  
## 09                 -0.26   -0.26                           -0.21          
## 10                 -0.26            0.20                    0.21          
## 11                                                                        
## 12                  0.24                                           -0.37  
## 13 -0.22    0.24                   -0.24           -0.30                  
## 14 -0.33   -0.21                                                   -0.47  
## 15                                  0.20                   -0.39    0.35  
## 16                                  0.23    0.43   -0.31    0.21   -0.21  
## 17                                                                  0.35  
## 18                                         -0.39   -0.28                  
## 19                          0.22                   -0.22                  
## 20                                         -0.37                   -0.26  
## 22          0.26   -0.25            0.24                                  
## 23 -0.30                           -0.33                                  
## 24                                 -0.37                                  
## 25                                                                        
## 26  0.24                   -0.20            0.27            0.31          
## 27                          0.50                            0.33          
## 28                                 -0.30                                  
## 30         -0.21    0.24                                    0.36          
##    Comp.20 Comp.21 Comp.22 Comp.23 Comp.24 Comp.25 Comp.26 Comp.27 Comp.28
## 29                         -0.26                           -0.25          
## 21                                                                        
## 01          0.23                                   -0.33           -0.25  
## 02  0.39            0.36                                   -0.34          
## 03  0.21                            0.35                                  
## 04 -0.21                           -0.33    0.38    0.24                  
## 05          0.40            0.20           -0.36            0.23          
## 06         -0.22            0.35                           -0.22          
## 07  0.23                            0.27                    0.22          
## 08         -0.36                                                          
## 09 -0.32    0.40   -0.22                                            0.21  
## 10                                 -0.33            0.44   -0.24          
## 11                                                          0.23   -0.47  
## 12 -0.29            0.45   -0.21                    0.23                  
## 13                          0.23    0.22                                  
## 14                 -0.20            0.22                    0.23          
## 15                                                  0.25    0.22          
## 16                                                         -0.21          
## 17         -0.40           -0.33           -0.35                          
## 18                 -0.22                                   -0.25    0.31  
## 19 -0.24           -0.27    0.41                           -0.27          
## 20  0.35                    0.33                                          
## 22 -0.20            0.35                    0.29   -0.30                  
## 23                                  0.33    0.28                   -0.23  
## 24                 -0.27           -0.34                                  
## 25                                                  0.48   -0.25   -0.26  
## 26  0.27                                                                  
## 27                                                                        
## 28 -0.28            0.27                   -0.25                    0.36  
## 30                                          0.32                    0.39  
##    Comp.29 Comp.30
## 29                
## 21                
## 01          0.41  
## 02                
## 03                
## 04                
## 05                
## 06  0.29          
## 07                
## 08                
## 09                
## 10 -0.22          
## 11  0.27          
## 12         -0.20  
## 13          0.38  
## 14 -0.33    0.21  
## 15 -0.27          
## 16                
## 17  0.28          
## 18          0.31  
## 19         -0.26  
## 20                
## 22 -0.31          
## 23                
## 24         -0.29  
## 25                
## 26 -0.24          
## 27  0.27    0.23  
## 28 -0.23          
## 30  0.27          
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.03   0.03   0.03   0.03   0.03   0.03   0.03   0.03
## Cumulative Var   0.03   0.07   0.10   0.13   0.17   0.20   0.23   0.27
##                Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
## SS loadings      1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var   0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var   0.30    0.33    0.37    0.40    0.43    0.47    0.50
##                Comp.16 Comp.17 Comp.18 Comp.19 Comp.20 Comp.21 Comp.22
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var    0.53    0.57    0.60    0.63    0.67    0.70    0.73
##                Comp.23 Comp.24 Comp.25 Comp.26 Comp.27 Comp.28 Comp.29
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var    0.77    0.80    0.83    0.87    0.90    0.93    0.97
##                Comp.30
## SS loadings       1.00
## Proportion Var    0.03
## Cumulative Var    1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "BI_S")
# pairs(S[, 1:6])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Orçamento empresarial

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis OE_*.

# Extrai e cria uma matriz com as variáveis de OE_*.
X <- da %>%
    select(starts_with("OE"))

oe_basica <- X %>%
    gather(key = "OE", value = "valor") %>%
    group_by(OE) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(OE = str_replace(OE, "OE_", ""))

oe_basica %>%
    print(n = Inf)
## # A tibble: 9 x 7
##   OE        n média mediana desvpad mínimo máximo
##   <chr> <int> <dbl>   <dbl>   <dbl>  <dbl>  <dbl>
## 1 01       94  6.09     7     1.42       1      7
## 2 02       94  3.13     3     1.84       1      7
## 3 03       94  2.87     3     1.86       1      7
## 4 04       94  2.49     2     1.90       1      7
## 5 05       94  2.31     1     1.75       1      7
## 6 06       94  2.45     1.5   1.77       1      7
## 7 07       94  6.29     7     1.13       1      7
## 8 08       94  6.45     7     0.980      1      7
## 9 09       94  5.69     6     1.32       1      7
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(oe_basica, aes(x = OE, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Orçamento empresarial") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 94  9
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("OE_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9
## 07         0.56                       -0.43         -0.53  -0.38 
## 08         0.54  -0.26   0.37   0.21          0.30   0.49   0.35 
## 02 -0.25          0.66   0.63          0.27                      
## 01         0.30   0.56  -0.59   0.39          0.23               
## 03 -0.43                       -0.60  -0.42   0.40   0.25        
## 09         0.49         -0.29  -0.59   0.49  -0.26               
## 06 -0.45         -0.31          0.24   0.53   0.28         -0.52 
## 04 -0.49                              -0.20  -0.72   0.39        
## 05 -0.51                                            -0.50   0.65 
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.11   0.11   0.11   0.11   0.11   0.11   0.11   0.11
## Cumulative Var   0.11   0.22   0.33   0.44   0.56   0.67   0.78   0.89
##                Comp.9
## SS loadings      1.00
## Proportion Var   0.11
## Cumulative Var   1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "OE_S")
# pairs(S[, 1:3])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Escala de autocontrole

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis EAC_*.

# Extrai e cria uma matriz com as variáveis de EAC_*.
X <- da %>%
    select(starts_with("EAC"))

eac_basica <- X %>%
    gather(key = "EAC", value = "valor") %>%
    group_by(EAC) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(EAC = str_replace(EAC, "EAC_", ""))

eac_basica %>%
    print(n = Inf)
## # A tibble: 24 x 7
##    EAC       n média mediana desvpad mínimo máximo
##    <chr> <int> <dbl>   <dbl>   <dbl>  <dbl>  <dbl>
##  1 01       94  1.62       1   0.869      1      4
##  2 02       94  1.39       1   0.736      1      4
##  3 03       94  1.59       1   0.822      1      4
##  4 04       94  1.80       2   0.934      1      4
##  5 05       94  2.62       3   1.06       1      4
##  6 06       94  2.38       2   1.14       1      4
##  7 07       94  1.44       1   0.784      1      4
##  8 08       94  2.14       2   1.12       1      4
##  9 09       94  1.79       2   0.902      1      4
## 10 10       94  2.77       3   1.04       1      4
## 11 11       94  2.18       2   1.07       1      4
## 12 12       94  2.54       3   1.14       1      4
## 13 13       94  2.30       2   1.09       1      4
## 14 14       94  2.15       2   0.972      1      4
## 15 15       94  1.51       1   0.786      1      4
## 16 16       94  1.65       1   0.901      1      4
## 17 17       94  1.61       1   0.819      1      4
## 18 18       94  1.65       1   0.758      1      4
## 19 19       94  2.03       2   0.848      1      4
## 20 20       94  1.41       1   0.646      1      4
## 21 21       94  2.12       2   0.971      1      4
## 22 22       94  1.82       2   0.867      1      4
## 23 23       94  1.64       1   0.801      1      4
## 24 24       94  2.13       2   1.06       1      4
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(eac_basica, aes(x = EAC, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Orçamento empresarial") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 94 24
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("EAC_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10
## 14 -0.21                 0.22         -0.38   0.54          0.24         
## 16 -0.24         -0.21                              -0.22  -0.30   0.52  
## 24        -0.37                       -0.22                              
## 15 -0.26         -0.24   0.22                       -0.26                
## 03 -0.31                       -0.44                                     
## 01 -0.28                       -0.27         -0.26   0.30         -0.34  
## 02 -0.33         -0.22                                            -0.35  
## 04 -0.28   0.21                -0.24   0.21                -0.25         
## 05        -0.26   0.23   0.28          0.22   0.38         -0.36         
## 06        -0.28   0.23   0.33                                            
## 07        -0.26          0.31                -0.29   0.40          0.30  
## 08        -0.21   0.30   0.25                                            
## 09 -0.26                        0.24   0.22         -0.28   0.26  -0.28  
## 10 -0.26          0.35                                             0.30  
## 11 -0.22   0.22   0.29                       -0.23                       
## 12                0.32                -0.41                -0.34  -0.27  
## 13                0.40                -0.28                              
## 17 -0.21  -0.20  -0.23                -0.41  -0.27          0.25         
## 18 -0.24                -0.20  -0.21          0.29          0.34         
## 19 -0.22                -0.32   0.30   0.20          0.21                
## 20                      -0.33   0.44   0.21          0.29  -0.22         
## 21        -0.28         -0.26  -0.34          0.21                       
## 22        -0.36         -0.21                       -0.32  -0.30         
## 23        -0.32         -0.31                       -0.33                
##    Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17 Comp.18 Comp.19
## 14                                 -0.20    0.23    0.21                  
## 16  0.20            0.27                                           -0.22  
## 24         -0.53   -0.29           -0.31                   -0.38          
## 15                 -0.25                   -0.25                          
## 03                                                                  0.33  
## 01                         -0.23                    0.37                  
## 02 -0.21                    0.33           -0.24   -0.33                  
## 04                                          0.46   -0.23                  
## 05                 -0.22   -0.22           -0.29                          
## 06 -0.36            0.43                    0.21           -0.39          
## 07                                 -0.33                    0.48          
## 08  0.37                   -0.32            0.22   -0.35                  
## 09                          0.29   -0.20            0.26                  
## 10                 -0.31    0.32    0.44   -0.21                          
## 11                         -0.34   -0.42   -0.31           -0.27   -0.29  
## 12                                  0.23                                  
## 13                                                 -0.40                  
## 17                                  0.37           -0.32                  
## 18         -0.23    0.45                   -0.35                          
## 19 -0.49    0.20           -0.39            0.26                          
## 20  0.30                    0.21                                          
## 21  0.21    0.44   -0.28                                           -0.43  
## 22  0.21    0.34                                                    0.46  
## 23 -0.31   -0.29                    0.21                    0.48   -0.27  
##    Comp.20 Comp.21 Comp.22 Comp.23 Comp.24
## 14 -0.29    0.22                          
## 16         -0.30           -0.20          
## 24                                        
## 15  0.51           -0.44                  
## 03 -0.28   -0.22   -0.28    0.51   -0.23  
## 01          0.28           -0.29   -0.28  
## 02 -0.40                   -0.38          
## 04  0.23            0.28            0.35  
## 05                  0.25           -0.31  
## 06          0.32                          
## 07                                        
## 08 -0.22           -0.26                  
## 09  0.22   -0.23    0.25           -0.24  
## 10          0.22           -0.21          
## 11 -0.21    0.21                          
## 12         -0.34                    0.39  
## 13  0.29                           -0.45  
## 17                  0.33    0.28          
## 18                                  0.34  
## 19         -0.26           -0.20          
## 20          0.40            0.30          
## 21                                        
## 22                  0.37                  
## 23                                        
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.04   0.04   0.04   0.04   0.04   0.04   0.04   0.04
## Cumulative Var   0.04   0.08   0.12   0.17   0.21   0.25   0.29   0.33
##                Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
## SS loadings      1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var   0.04    0.04    0.04    0.04    0.04    0.04    0.04
## Cumulative Var   0.37    0.42    0.46    0.50    0.54    0.58    0.62
##                Comp.16 Comp.17 Comp.18 Comp.19 Comp.20 Comp.21 Comp.22
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.04    0.04    0.04    0.04    0.04    0.04    0.04
## Cumulative Var    0.67    0.71    0.75    0.79    0.83    0.88    0.92
##                Comp.23 Comp.24
## SS loadings       1.00    1.00
## Proportion Var    0.04    0.04
## Cumulative Var    0.96    1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "EAC_S")
# pairs(S[, 1:3])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Análise exploratória das decisões

#-----------------------------------------------------------------------
# Gráficos.

# Proporção de acertos da tarefa das matrizes por grupo de autocontrole.
da %>%
    group_by(autocon) %>%
    summarise(prop = mean(TM))
## # A tibble: 2 x 2
##   autocon  prop
##   <fct>   <dbl>
## 1 A       0.579
## 2 C       0.811
db <- list()

# Empilha as decisões.
db[[1]] <- da %>%
    select(Participantes, TM, autocon, starts_with("D_")) %>%
    gather(key = "decisoes", value = "acerto", contains("D_"))

# Empilha as confianças nas decisões.
db[[2]] <- da %>%
    select(Participantes, starts_with("C_")) %>%
    gather(key = "decisoes", value = "nivel", contains("C_")) %>%
    mutate(nivel = 10 * nivel)

# str(db[[1]])
# str(db[[2]])

# Remove os prefixos `D_` e `C_`.
db[[1]]$decisoes <- db[[1]]$decisoes %>% str_replace("D_", "")
db[[2]]$decisoes <- db[[2]]$decisoes %>% str_replace("C_", "")

# Junção da parte da decisões com as confianças.
db <- full_join(db[[1]], db[[2]])
## Joining, by = c("Participantes", "decisoes")
str(db)
## 'data.frame':    3760 obs. of  6 variables:
##  $ Participantes: chr  "A01" "A02" "A03" "A04" ...
##  $ TM           : int  1 0 1 0 1 1 1 1 1 0 ...
##  $ autocon      : Factor w/ 2 levels "A","C": 1 1 1 1 1 1 1 1 1 1 ...
##  $ decisoes     : chr  "01" "01" "01" "01" ...
##  $ acerto       : int  0 0 1 0 0 1 1 0 0 0 ...
##  $ nivel        : num  80 80 100 100 100 60 80 90 80 80 ...
# Renomeia para que D_21 seja D_01 e assim por diante.
u <- decis[match(x = db$decisoes,
                 table = decis[, 2],), 1]
db$decisoes[!is.na(u)] <- u[!is.na(u)]

# Passa para inteiro.
db$decisoes <- db$decisoes %>%
    as.integer()

# Obtém a estatística descritiva.
db_prop <- db %>%
    group_by(autocon, decisoes) %>%
    summarise(acerto_prop = mean(acerto),
              conf_média = mean(nivel),
              conf_sd = sd(nivel))

db_prop %>%
    print(n = Inf)
## # A tibble: 40 x 5
## # Groups:   autocon [?]
##    autocon decisoes acerto_prop conf_média conf_sd
##    <fct>      <int>       <dbl>      <dbl>   <dbl>
##  1 A              1       0.395       74.5    14.6
##  2 A              2       0.737       76.3    14.3
##  3 A              3       0.719       78.9    12.7
##  4 A              4       0.675       76.6    11.7
##  5 A              5       0.711       78.1    12.6
##  6 A              6       0.561       78.4    11.6
##  7 A              7       0.588       78.0    12.2
##  8 A              8       0.482       79.9    13.1
##  9 A              9       0.746       77.0    14.1
## 10 A             10       0.579       76.8    13.3
## 11 A             11       0.596       74.6    13.4
## 12 A             12       0.816       79.9    13.3
## 13 A             13       0.439       78.9    12.9
## 14 A             14       0.456       78.1    13.9
## 15 A             15       0.570       76.9    12.7
## 16 A             16       0.763       79.1    13.7
## 17 A             17       0.553       75.6    13.0
## 18 A             18       0.553       75      12.9
## 19 A             19       0.535       75      12.6
## 20 A             20       0.649       82.4    14.3
## 21 C              1       0.446       73.1    15.6
## 22 C              2       0.743       75      15.5
## 23 C              3       0.770       76.1    13.8
## 24 C              4       0.770       76.1    14.2
## 25 C              5       0.743       88.0    85.0
## 26 C              6       0.581       75.5    14.5
## 27 C              7       0.581       76.4    12.6
## 28 C              8       0.581       79.3    13.9
## 29 C              9       0.797       78.1    14.3
## 30 C             10       0.608       74.5    13.8
## 31 C             11       0.595       74.2    13.7
## 32 C             12       0.824       80.3    14.6
## 33 C             13       0.568       74.6    14.5
## 34 C             14       0.486       76.6    13.3
## 35 C             15       0.622       75.3    14.6
## 36 C             16       0.824       79.2    14.5
## 37 C             17       0.554       74.6    13.8
## 38 C             18       0.649       75.7    14.5
## 39 C             19       0.635       75.8    14.6
## 40 C             20       0.784       80.5    15.5
# Versão lado a lado para acerto.
db_prop %>%
    select(autocon, decisoes, acerto_prop) %>%
    spread(key = autocon, value = acerto_prop)
## # A tibble: 20 x 3
##    decisoes     A     C
##       <int> <dbl> <dbl>
##  1        1 0.395 0.446
##  2        2 0.737 0.743
##  3        3 0.719 0.770
##  4        4 0.675 0.770
##  5        5 0.711 0.743
##  6        6 0.561 0.581
##  7        7 0.588 0.581
##  8        8 0.482 0.581
##  9        9 0.746 0.797
## 10       10 0.579 0.608
## 11       11 0.596 0.595
## 12       12 0.816 0.824
## 13       13 0.439 0.568
## 14       14 0.456 0.486
## 15       15 0.570 0.622
## 16       16 0.763 0.824
## 17       17 0.553 0.554
## 18       18 0.553 0.649
## 19       19 0.535 0.635
## 20       20 0.649 0.784
# Versão lado a lado para confiança média.
db_prop %>%
    select(autocon, decisoes, conf_média) %>%
    spread(key = autocon, value = conf_média)
## # A tibble: 20 x 3
##    decisoes     A     C
##       <int> <dbl> <dbl>
##  1        1  74.5  73.1
##  2        2  76.3  75  
##  3        3  78.9  76.1
##  4        4  76.6  76.1
##  5        5  78.1  88.0
##  6        6  78.4  75.5
##  7        7  78.0  76.4
##  8        8  79.9  79.3
##  9        9  77.0  78.1
## 10       10  76.8  74.5
## 11       11  74.6  74.2
## 12       12  79.9  80.3
## 13       13  78.9  74.6
## 14       14  78.1  76.6
## 15       15  76.9  75.3
## 16       16  79.1  79.2
## 17       17  75.6  74.6
## 18       18  75    75.7
## 19       19  75    75.8
## 20       20  82.4  80.5
gg1 <-
ggplot(db_prop,
       aes(x = autocon,
           y = acerto_prop,
           group = decisoes)) +
    geom_point() +
    geom_line() +
    geom_text(aes(x = (as.integer(autocon) +
                       0.075 * scale(as.integer(autocon))),
                  label = decisoes)) +
    ylab("Proporção de acerto") +
    xlab("Autocontrole")

gg2 <-
ggplot(db_prop,
       aes(x = autocon,
           y = conf_média,
           group = decisoes)) +
    geom_point() +
    # geom_point(aes(size = conf_sd)) +
    geom_line() +
    geom_text(aes(x = (as.integer(autocon) +
                       0.075 * scale(as.integer(autocon))),
                  label = decisoes)) +
    ylab("Confiança média") +
    xlab("Autocontrole")

grid.arrange(gg1, gg2, nrow = 1)

Regressão logística para cada decisão

#-----------------------------------------------------------------------
# Análise de regressão logística.

# Cria correspondência entre decisões.
decis <- "D_" %>%
    str_c(decis) %>%
    matrix(ncol = 2)

# Porção apenas com os escores da ACP.
da_scores <- da %>%
    select(Participantes,
           starts_with("BI_S"),
           starts_with("OE_S"),
           starts_with("EAC_S"))

# Coloca os escores ao lado das variáveis filtrando para a decisão.
dd <- db %>%
    filter(decisoes == 1) %>%
    full_join(da_scores)
## Joining, by = "Participantes"
# Ajuste do modelo.
fit <- glm(acerto ~
               EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
               OE_S1 + OE_S2 + OE_S3 +
               BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
               autocon * nivel +
               autocon * TM,
           data = dd,
           family = quasibinomial)

# anova(fit, test = "F")
drop1(fit, test = "F", scope = . ~ .)
## Single term deletions
## 
## Model:
## acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 + 
##     OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 + 
##     autocon * nivel + autocon * TM
##               Df Deviance F value Pr(>F)
## <none>             240.92               
## EAC_S1         1   241.22  0.2037 0.6524
## EAC_S2         1   241.73  0.5606 0.4551
## EAC_S3         1   241.17  0.1705 0.6802
## EAC_S4         1   240.93  0.0033 0.9540
## EAC_S5         1   241.23  0.2164 0.6424
## EAC_S6         1   242.50  1.1028 0.2952
## OE_S1          1   241.01  0.0603 0.8063
## OE_S2          1   242.91  1.3851 0.2409
## OE_S3          1   241.12  0.1398 0.7090
## BI_S1          1   241.28  0.2470 0.6198
## BI_S2          1   241.82  0.6253 0.4302
## BI_S3          1   241.93  0.6985 0.4045
## BI_S4          1   240.92  0.0001 0.9936
## BI_S5          1   241.55  0.4387 0.5087
## autocon        1   242.45  1.0654 0.3035
## nivel          1   241.31  0.2714 0.6031
## TM             1   242.36  1.0046 0.3176
## autocon:nivel  1   241.88  0.6673 0.4151
## autocon:TM     1   241.31  0.2705 0.6037
summary(fit)
## 
## Call:
## glm(formula = acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + 
##     EAC_S6 + OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + 
##     BI_S4 + BI_S5 + autocon * nivel + autocon * TM, family = quasibinomial, 
##     data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5767  -1.0189  -0.7352   1.1771   1.9489  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)
## (Intercept)    -0.156741   1.274005  -0.123    0.902
## EAC_S1         -0.050532   0.099073  -0.510    0.611
## EAC_S2          0.094227   0.111554   0.845    0.399
## EAC_S3          0.055877   0.119744   0.467    0.641
## EAC_S4          0.008862   0.135745   0.065    0.948
## EAC_S5         -0.079540   0.151565  -0.525    0.600
## EAC_S6         -0.209219   0.177156  -1.181    0.239
## OE_S1           0.029197   0.105350   0.277    0.782
## OE_S2           0.168343   0.130638   1.289    0.199
## OE_S3          -0.069552   0.164748  -0.422    0.673
## BI_S1          -0.053820   0.095959  -0.561    0.576
## BI_S2          -0.119966   0.134807  -0.890    0.375
## BI_S3           0.119881   0.127486   0.940    0.348
## BI_S4           0.001184   0.130863   0.009    0.993
## BI_S5          -0.106694   0.142603  -0.748    0.455
## autoconC        2.353940   2.030829   1.159    0.248
## nivel          -0.009312   0.015839  -0.588    0.557
## TM              0.527786   0.468477   1.127    0.262
## autoconC:nivel -0.022424   0.024422  -0.918    0.360
## autoconC:TM    -0.502397   0.852919  -0.589    0.557
## 
## (Dispersion parameter for quasibinomial family taken to be 1.122522)
## 
##     Null deviance: 255.15  on 187  degrees of freedom
## Residual deviance: 240.92  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
# Fórmula do preditor linear que será usado em todas as decisões.
formula <- acerto ~
    EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
    OE_S1 + OE_S2 + OE_S3 +
    BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
    autocon * nivel +
    autocon * TM

# Ajustes em lote para cada decisão.
all_fits <- lapply(1:20,
                   FUN = function(i) {
                       dd <- db %>%
                           filter(decisoes == i) %>%
                           full_join(da_scores)
                       fit <- glm(formula = formula,
                                  data = dd,
                                  family = quasibinomial)
                       return(fit)
                   })
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
# lapply(all_fits, anova, test = "F")
# lapply(all_fits, drop1, test = "F", scope = . ~ .)
lapply(all_fits, summary)
## [[1]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.5767  -1.0189  -0.7352   1.1771   1.9489  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)
## (Intercept)    -0.156741   1.274005  -0.123    0.902
## EAC_S1         -0.050532   0.099073  -0.510    0.611
## EAC_S2          0.094227   0.111554   0.845    0.399
## EAC_S3          0.055877   0.119744   0.467    0.641
## EAC_S4          0.008862   0.135745   0.065    0.948
## EAC_S5         -0.079540   0.151565  -0.525    0.600
## EAC_S6         -0.209219   0.177156  -1.181    0.239
## OE_S1           0.029197   0.105350   0.277    0.782
## OE_S2           0.168343   0.130638   1.289    0.199
## OE_S3          -0.069552   0.164748  -0.422    0.673
## BI_S1          -0.053820   0.095959  -0.561    0.576
## BI_S2          -0.119966   0.134807  -0.890    0.375
## BI_S3           0.119881   0.127486   0.940    0.348
## BI_S4           0.001184   0.130863   0.009    0.993
## BI_S5          -0.106694   0.142603  -0.748    0.455
## autoconC        2.353940   2.030829   1.159    0.248
## nivel          -0.009312   0.015839  -0.588    0.557
## TM              0.527786   0.468477   1.127    0.262
## autoconC:nivel -0.022424   0.024422  -0.918    0.360
## autoconC:TM    -0.502397   0.852919  -0.589    0.557
## 
## (Dispersion parameter for quasibinomial family taken to be 1.122522)
## 
##     Null deviance: 255.15  on 187  degrees of freedom
## Residual deviance: 240.92  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[2]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2166  -0.8513   0.5639   0.7783   1.3009  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     2.398333   1.526724   1.571   0.1181  
## EAC_S1          0.099680   0.120805   0.825   0.4105  
## EAC_S2          0.054978   0.128915   0.426   0.6703  
## EAC_S3         -0.050467   0.129789  -0.389   0.6979  
## EAC_S4          0.004471   0.161294   0.028   0.9779  
## EAC_S5         -0.238441   0.171859  -1.387   0.1672  
## EAC_S6          0.298175   0.203454   1.466   0.1446  
## OE_S1           0.141180   0.120680   1.170   0.2437  
## OE_S2          -0.098029   0.159285  -0.615   0.5391  
## OE_S3          -0.317600   0.193521  -1.641   0.1026  
## BI_S1          -0.082259   0.115662  -0.711   0.4779  
## BI_S2           0.056164   0.169710   0.331   0.7411  
## BI_S3           0.260932   0.162241   1.608   0.1096  
## BI_S4          -0.208926   0.151823  -1.376   0.1706  
## BI_S5          -0.115159   0.174588  -0.660   0.5104  
## autoconC       -1.653095   2.410248  -0.686   0.4937  
## nivel          -0.023794   0.019033  -1.250   0.2130  
## TM              0.995970   0.516487   1.928   0.0555 .
## autoconC:nivel  0.036387   0.028139   1.293   0.1978  
## autoconC:TM    -1.558347   0.998782  -1.560   0.1206  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.116303)
## 
##     Null deviance: 215.72  on 187  degrees of freedom
## Residual deviance: 195.11  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[3]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.6335  -0.7806   0.4922   0.7038   1.5463  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -0.986252   1.806462  -0.546   0.5858  
## EAC_S1          0.154704   0.134822   1.147   0.2528  
## EAC_S2          0.295849   0.146023   2.026   0.0443 *
## EAC_S3         -0.139684   0.143664  -0.972   0.3323  
## EAC_S4          0.095085   0.173013   0.550   0.5833  
## EAC_S5         -0.520872   0.207391  -2.512   0.0130 *
## EAC_S6         -0.081818   0.215192  -0.380   0.7043  
## OE_S1           0.296856   0.135896   2.184   0.0303 *
## OE_S2           0.268151   0.148270   1.809   0.0723 .
## OE_S3          -0.445962   0.218599  -2.040   0.0429 *
## BI_S1          -0.308909   0.125066  -2.470   0.0145 *
## BI_S2          -0.111162   0.190396  -0.584   0.5601  
## BI_S3           0.156103   0.181458   0.860   0.3909  
## BI_S4           0.112472   0.165059   0.681   0.4966  
## BI_S5           0.121465   0.188594   0.644   0.5204  
## autoconC        1.384593   2.734258   0.506   0.6132  
## nivel           0.020334   0.022804   0.892   0.3738  
## TM              0.915140   0.566729   1.615   0.1082  
## autoconC:nivel  0.004258   0.033132   0.129   0.8979  
## autoconC:TM    -1.722530   1.179567  -1.460   0.1461  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.196757)
## 
##     Null deviance: 215.72  on 187  degrees of freedom
## Residual deviance: 178.53  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[4]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.3744  -0.9876   0.5370   0.8023   1.6533  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -2.649228   1.596520  -1.659   0.0989 .
## EAC_S1          0.078423   0.120375   0.651   0.5156  
## EAC_S2          0.170748   0.126774   1.347   0.1798  
## EAC_S3          0.085483   0.135136   0.633   0.5279  
## EAC_S4          0.094748   0.156043   0.607   0.5445  
## EAC_S5         -0.319593   0.186329  -1.715   0.0882 .
## EAC_S6          0.053320   0.193981   0.275   0.7838  
## OE_S1           0.207812   0.121442   1.711   0.0889 .
## OE_S2           0.111921   0.134736   0.831   0.4073  
## OE_S3          -0.242281   0.191239  -1.267   0.2069  
## BI_S1          -0.154223   0.112369  -1.372   0.1717  
## BI_S2          -0.132586   0.171743  -0.772   0.4412  
## BI_S3           0.255181   0.161635   1.579   0.1163  
## BI_S4          -0.083451   0.145197  -0.575   0.5662  
## BI_S5          -0.000552   0.169142  -0.003   0.9974  
## autoconC        1.824532   2.555143   0.714   0.4762  
## nivel           0.038474   0.020423   1.884   0.0613 .
## TM              0.891678   0.493447   1.807   0.0725 .
## autoconC:nivel  0.005741   0.031213   0.184   0.8543  
## autoconC:TM    -2.044020   1.125541  -1.816   0.0711 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.095919)
## 
##     Null deviance: 225.47  on 187  degrees of freedom
## Residual deviance: 193.64  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[5]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2420  -1.0047   0.5911   0.7704   1.5413  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     0.673085   1.690457   0.398  0.69101   
## EAC_S1          0.127848   0.118394   1.080  0.28176   
## EAC_S2          0.243008   0.128100   1.897  0.05954 . 
## EAC_S3         -0.283024   0.130902  -2.162  0.03202 * 
## EAC_S4          0.190390   0.157634   1.208  0.22882   
## EAC_S5         -0.062907   0.171866  -0.366  0.71481   
## EAC_S6          0.006826   0.197272   0.035  0.97244   
## OE_S1           0.024450   0.124103   0.197  0.84406   
## OE_S2           0.021417   0.131842   0.162  0.87115   
## OE_S3          -0.198848   0.191437  -1.039  0.30043   
## BI_S1          -0.325147   0.117619  -2.764  0.00634 **
## BI_S2           0.092165   0.158806   0.580  0.56245   
## BI_S3           0.027660   0.146015   0.189  0.84998   
## BI_S4           0.124898   0.149840   0.834  0.40572   
## BI_S5           0.141524   0.165083   0.857  0.39250   
## autoconC       -3.849244   2.702767  -1.424  0.15625   
## nivel          -0.001017   0.020867  -0.049  0.96121   
## TM              0.718186   0.504933   1.422  0.15678   
## autoconC:nivel  0.047653   0.031958   1.491  0.13781   
## autoconC:TM     0.219533   0.937407   0.234  0.81512   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.119993)
## 
##     Null deviance: 221.73  on 187  degrees of freedom
## Residual deviance: 197.82  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 6
## 
## 
## [[6]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.5477  -1.0547   0.5010   0.9068   1.9205  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     9.837e-02  1.737e+00   0.057  0.95491   
## EAC_S1          1.511e-01  1.091e-01   1.385  0.16792   
## EAC_S2          4.473e-01  1.383e-01   3.234  0.00147 **
## EAC_S3          1.904e-01  1.372e-01   1.387  0.16722   
## EAC_S4         -2.612e-01  1.568e-01  -1.666  0.09763 . 
## EAC_S5          2.101e-03  1.700e-01   0.012  0.99015   
## EAC_S6          6.612e-02  2.080e-01   0.318  0.75097   
## OE_S1           1.608e-01  1.191e-01   1.350  0.17899   
## OE_S2          -6.217e-02  1.713e-01  -0.363  0.71717   
## OE_S3          -1.533e-01  1.840e-01  -0.833  0.40587   
## BI_S1          -2.076e-01  1.082e-01  -1.919  0.05674 . 
## BI_S2           1.582e-01  1.665e-01   0.950  0.34333   
## BI_S3           4.024e-01  1.557e-01   2.584  0.01063 * 
## BI_S4          -1.374e-01  1.521e-01  -0.904  0.36746   
## BI_S5          -2.953e-02  1.558e-01  -0.190  0.84991   
## autoconC        2.330e+00  2.535e+00   0.919  0.35948   
## nivel          -8.760e-06  2.163e-02   0.000  0.99968   
## TM              1.561e-01  4.822e-01   0.324  0.74663   
## autoconC:nivel  2.817e-03  3.002e-02   0.094  0.92535   
## autoconC:TM    -2.668e+00  1.115e+00  -2.392  0.01785 * 
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.161787)
## 
##     Null deviance: 257.02  on 187  degrees of freedom
## Residual deviance: 214.95  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[7]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9021  -1.0740   0.6416   0.9612   1.7670  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     1.43608    1.58625   0.905   0.3666  
## EAC_S1          0.02922    0.10250   0.285   0.7759  
## EAC_S2          0.26489    0.11762   2.252   0.0256 *
## EAC_S3          0.05940    0.11779   0.504   0.6148  
## EAC_S4         -0.15964    0.14522  -1.099   0.2732  
## EAC_S5          0.01371    0.15917   0.086   0.9315  
## EAC_S6          0.05898    0.18632   0.317   0.7520  
## OE_S1           0.10211    0.10828   0.943   0.3470  
## OE_S2           0.13847    0.12496   1.108   0.2694  
## OE_S3          -0.27181    0.17718  -1.534   0.1269  
## BI_S1          -0.21329    0.10267  -2.077   0.0393 *
## BI_S2           0.02254    0.14384   0.157   0.8756  
## BI_S3           0.32288    0.14202   2.273   0.0243 *
## BI_S4          -0.10398    0.14407  -0.722   0.4715  
## BI_S5          -0.19443    0.15304  -1.270   0.2057  
## autoconC        2.11231    2.40794   0.877   0.3816  
## nivel          -0.01866    0.02025  -0.922   0.3581  
## TM              0.59504    0.47057   1.265   0.2078  
## autoconC:nivel -0.01469    0.02966  -0.495   0.6210  
## autoconC:TM    -1.17877    0.86349  -1.365   0.1740  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.094101)
## 
##     Null deviance: 255.15  on 187  degrees of freedom
## Residual deviance: 225.88  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[8]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9932  -1.0282   0.3268   1.0173   2.0585  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     0.82756    1.52883   0.541  0.58902   
## EAC_S1          0.28698    0.11568   2.481  0.01409 * 
## EAC_S2          0.20328    0.11601   1.752  0.08157 . 
## EAC_S3          0.11348    0.12306   0.922  0.35779   
## EAC_S4         -0.08927    0.14104  -0.633  0.52762   
## EAC_S5         -0.15762    0.17469  -0.902  0.36819   
## EAC_S6         -0.51959    0.20419  -2.545  0.01184 * 
## OE_S1          -0.02750    0.11304  -0.243  0.80811   
## OE_S2           0.06959    0.12354   0.563  0.57400   
## OE_S3          -0.29236    0.17788  -1.644  0.10214   
## BI_S1          -0.22077    0.10241  -2.156  0.03252 * 
## BI_S2          -0.12912    0.14654  -0.881  0.37950   
## BI_S3           0.15523    0.13538   1.147  0.25318   
## BI_S4           0.08214    0.14014   0.586  0.55859   
## BI_S5          -0.16421    0.14809  -1.109  0.26908   
## autoconC        4.50225    2.55172   1.764  0.07948 . 
## nivel          -0.01710    0.01884  -0.908  0.36527   
## TM              0.68799    0.45380   1.516  0.13138   
## autoconC:nivel -0.01774    0.02807  -0.632  0.52829   
## autoconC:TM    -3.19895    1.09045  -2.934  0.00382 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.090418)
## 
##     Null deviance: 260.28  on 187  degrees of freedom
## Residual deviance: 220.35  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[9]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2788   0.2198   0.4491   0.7393   1.4462  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -0.518075   1.453664  -0.356   0.7220  
## EAC_S1          0.205918   0.124356   1.656   0.0996 .
## EAC_S2          0.057231   0.132556   0.432   0.6665  
## EAC_S3          0.124386   0.145864   0.853   0.3950  
## EAC_S4          0.054406   0.168057   0.324   0.7465  
## EAC_S5         -0.298396   0.183825  -1.623   0.1064  
## EAC_S6          0.212838   0.209712   1.015   0.3116  
## OE_S1           0.189066   0.126748   1.492   0.1377  
## OE_S2          -0.077921   0.152024  -0.513   0.6089  
## OE_S3          -0.500484   0.210537  -2.377   0.0186 *
## BI_S1          -0.150841   0.117694  -1.282   0.2017  
## BI_S2           0.111102   0.172948   0.642   0.5215  
## BI_S3           0.007576   0.154816   0.049   0.9610  
## BI_S4          -0.093263   0.154678  -0.603   0.5474  
## BI_S5          -0.080302   0.184622  -0.435   0.6642  
## autoconC       -3.942957   2.623937  -1.503   0.1348  
## nivel           0.015302   0.018695   0.819   0.4142  
## TM              1.105094   0.519476   2.127   0.0349 *
## autoconC:nivel  0.053005   0.031882   1.663   0.0983 .
## autoconC:TM    -0.007857   0.954739  -0.008   0.9934  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.047164)
## 
##     Null deviance: 204.59  on 187  degrees of freedom
## Residual deviance: 172.00  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[10]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.1233  -1.0320   0.6477   0.9225   1.7113  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -0.05477    1.48826  -0.037  0.97069   
## EAC_S1          0.09057    0.10225   0.886  0.37705   
## EAC_S2          0.34871    0.12298   2.836  0.00514 **
## EAC_S3          0.18466    0.12623   1.463  0.14536   
## EAC_S4         -0.07581    0.14555  -0.521  0.60315   
## EAC_S5          0.15813    0.15843   0.998  0.31967   
## EAC_S6          0.10233    0.19520   0.524  0.60081   
## OE_S1           0.18163    0.11284   1.610  0.10936   
## OE_S2           0.03210    0.14672   0.219  0.82706   
## OE_S3          -0.12915    0.17804  -0.725  0.46922   
## BI_S1          -0.19724    0.10354  -1.905  0.05848 . 
## BI_S2           0.20881    0.14901   1.401  0.16297   
## BI_S3           0.17987    0.13894   1.295  0.19725   
## BI_S4          -0.15776    0.14418  -1.094  0.27542   
## BI_S5          -0.17592    0.14997  -1.173  0.24244   
## autoconC        1.75130    2.21378   0.791  0.43001   
## nivel           0.00168    0.01858   0.090  0.92809   
## TM              0.34024    0.46572   0.731  0.46606   
## autoconC:nivel -0.01001    0.02772  -0.361  0.71850   
## autoconC:TM    -0.90028    0.88865  -1.013  0.31248   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.126793)
## 
##     Null deviance: 254.44  on 187  degrees of freedom
## Residual deviance: 224.78  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[11]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2956  -0.9045   0.5315   0.8845   1.9272  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     1.235306   1.493254   0.827  0.40926   
## EAC_S1          0.226547   0.107959   2.098  0.03736 * 
## EAC_S2          0.383032   0.132731   2.886  0.00442 **
## EAC_S3          0.118694   0.134840   0.880  0.37998   
## EAC_S4         -0.149297   0.148857  -1.003  0.31733   
## EAC_S5          0.079969   0.170296   0.470  0.63926   
## EAC_S6          0.035278   0.203506   0.173  0.86258   
## OE_S1           0.136638   0.116376   1.174  0.24201   
## OE_S2           0.035701   0.145723   0.245  0.80676   
## OE_S3           0.019710   0.179582   0.110  0.91273   
## BI_S1          -0.348188   0.110648  -3.147  0.00195 **
## BI_S2           0.148565   0.160327   0.927  0.35544   
## BI_S3           0.314336   0.145358   2.162  0.03199 * 
## BI_S4          -0.044236   0.145463  -0.304  0.76143   
## BI_S5           0.004615   0.153235   0.030  0.97601   
## autoconC        1.902246   2.487370   0.765  0.44549   
## nivel          -0.014997   0.019552  -0.767  0.44416   
## TM              0.468991   0.487065   0.963  0.33699   
## autoconC:nivel  0.009014   0.029678   0.304  0.76172   
## autoconC:TM    -3.082144   1.120043  -2.752  0.00658 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.113315)
## 
##     Null deviance: 253.69  on 187  degrees of freedom
## Residual deviance: 209.75  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[12]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2498   0.1540   0.3395   0.6053   1.6623  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -2.488143   1.969587  -1.263  0.20824   
## EAC_S1          0.402431   0.150196   2.679  0.00811 **
## EAC_S2          0.072598   0.132981   0.546  0.58584   
## EAC_S3         -0.229156   0.142769  -1.605  0.11035   
## EAC_S4         -0.034968   0.193414  -0.181  0.85675   
## EAC_S5         -0.236965   0.184816  -1.282  0.20155   
## EAC_S6          0.187586   0.223364   0.840  0.40220   
## OE_S1          -0.003383   0.125934  -0.027  0.97860   
## OE_S2           0.140561   0.133055   1.056  0.29230   
## OE_S3          -0.106554   0.219204  -0.486  0.62753   
## BI_S1          -0.348650   0.124370  -2.803  0.00565 **
## BI_S2           0.164650   0.194207   0.848  0.39775   
## BI_S3           0.318626   0.180810   1.762  0.07985 . 
## BI_S4          -0.022720   0.184688  -0.123  0.90224   
## BI_S5          -0.157260   0.215058  -0.731  0.46565   
## autoconC       -0.421151   2.610330  -0.161  0.87202   
## nivel           0.045895   0.025162   1.824  0.06994 . 
## TM              1.460319   0.594414   2.457  0.01504 * 
## autoconC:nivel  0.003077   0.032194   0.096  0.92398   
## autoconC:TM     0.022838   0.913740   0.025  0.98009   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 0.8679743)
## 
##     Null deviance: 177.73  on 187  degrees of freedom
## Residual deviance: 138.26  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 6
## 
## 
## [[13]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8626  -1.0407  -0.3737   1.1101   1.7542  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     1.19382    1.51574   0.788   0.4320  
## EAC_S1          0.19540    0.10565   1.849   0.0662 .
## EAC_S2          0.25403    0.12120   2.096   0.0376 *
## EAC_S3          0.08537    0.12439   0.686   0.4935  
## EAC_S4         -0.08743    0.14258  -0.613   0.5406  
## EAC_S5          0.12847    0.15809   0.813   0.4176  
## EAC_S6         -0.02218    0.19646  -0.113   0.9102  
## OE_S1           0.08369    0.11261   0.743   0.4584  
## OE_S2          -0.31846    0.16374  -1.945   0.0535 .
## OE_S3          -0.22430    0.17567  -1.277   0.2034  
## BI_S1          -0.08213    0.10077  -0.815   0.4162  
## BI_S2           0.05816    0.14798   0.393   0.6948  
## BI_S3           0.13587    0.13390   1.015   0.3117  
## BI_S4          -0.10210    0.14153  -0.721   0.4716  
## BI_S5          -0.16956    0.14246  -1.190   0.2356  
## autoconC        1.65191    2.20237   0.750   0.4543  
## nivel          -0.02032    0.01876  -1.083   0.2802  
## TM              0.26230    0.44966   0.583   0.5604  
## autoconC:nivel  0.01096    0.02567   0.427   0.6700  
## autoconC:TM    -2.47581    1.01028  -2.451   0.0153 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.070658)
## 
##     Null deviance: 260.54  on 187  degrees of freedom
## Residual deviance: 226.12  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[14]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0707  -0.9727  -0.4058   1.0002   1.9958  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     4.05163    1.74314   2.324  0.02130 * 
## EAC_S1          0.08895    0.10788   0.825  0.41080   
## EAC_S2          0.40609    0.13052   3.111  0.00219 **
## EAC_S3         -0.17319    0.13148  -1.317  0.18956   
## EAC_S4         -0.22550    0.15470  -1.458  0.14680   
## EAC_S5          0.22626    0.16106   1.405  0.16192   
## EAC_S6          0.21629    0.21406   1.010  0.31374   
## OE_S1           0.16504    0.11895   1.387  0.16713   
## OE_S2           0.05437    0.12791   0.425  0.67135   
## OE_S3          -0.12073    0.18191  -0.664  0.50779   
## BI_S1          -0.21088    0.10676  -1.975  0.04987 * 
## BI_S2           0.12971    0.14766   0.878  0.38097   
## BI_S3           0.21564    0.13143   1.641  0.10274   
## BI_S4          -0.06094    0.15506  -0.393  0.69481   
## BI_S5          -0.24657    0.15235  -1.618  0.10745   
## autoconC       -0.55684    2.39773  -0.232  0.81664   
## nivel          -0.05478    0.02145  -2.554  0.01154 * 
## TM             -0.13067    0.48616  -0.269  0.78842   
## autoconC:nivel  0.01346    0.02892   0.465  0.64231   
## autoconC:TM    -0.28391    0.89299  -0.318  0.75093   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.132724)
## 
##     Null deviance: 259.86  on 187  degrees of freedom
## Residual deviance: 221.81  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[15]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.6068  -0.9352   0.4430   0.9419   1.9821  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -0.055059   1.672712  -0.033  0.97378   
## EAC_S1          0.237436   0.117364   2.023  0.04465 * 
## EAC_S2          0.254901   0.130118   1.959  0.05177 . 
## EAC_S3          0.192491   0.136271   1.413  0.15963   
## EAC_S4         -0.135716   0.155594  -0.872  0.38432   
## EAC_S5         -0.042354   0.173581  -0.244  0.80753   
## EAC_S6          0.021405   0.203847   0.105  0.91650   
## OE_S1          -0.047793   0.121515  -0.393  0.69459   
## OE_S2          -0.211628   0.173852  -1.217  0.22520   
## OE_S3          -0.279432   0.192732  -1.450  0.14897   
## BI_S1          -0.214551   0.113997  -1.882  0.06156 . 
## BI_S2           0.181481   0.164553   1.103  0.27166   
## BI_S3           0.497596   0.167436   2.972  0.00339 **
## BI_S4          -0.154550   0.154463  -1.001  0.31848   
## BI_S5          -0.239747   0.155680  -1.540  0.12544   
## autoconC        2.934453   2.565084   1.144  0.25425   
## nivel          -0.002608   0.021388  -0.122  0.90309   
## TM              0.933220   0.491843   1.897  0.05949 . 
## autoconC:nivel  0.011614   0.028511   0.407  0.68428   
## autoconC:TM    -4.212394   1.358996  -3.100  0.00227 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.166102)
## 
##     Null deviance: 254.44  on 187  degrees of freedom
## Residual deviance: 209.94  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[16]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.5986   0.2299   0.4326   0.6623   1.8459  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -3.063474   1.759215  -1.741   0.0834 .
## EAC_S1          0.217742   0.138650   1.570   0.1182  
## EAC_S2          0.009189   0.133008   0.069   0.9450  
## EAC_S3         -0.367682   0.150121  -2.449   0.0153 *
## EAC_S4          0.120645   0.189317   0.637   0.5248  
## EAC_S5         -0.414695   0.194048  -2.137   0.0340 *
## EAC_S6         -0.309431   0.237681  -1.302   0.1947  
## OE_S1           0.049709   0.131808   0.377   0.7066  
## OE_S2           0.224112   0.150384   1.490   0.1380  
## OE_S3          -0.026128   0.210329  -0.124   0.9013  
## BI_S1          -0.240249   0.121138  -1.983   0.0490 *
## BI_S2          -0.147828   0.181128  -0.816   0.4156  
## BI_S3          -0.029854   0.156111  -0.191   0.8486  
## BI_S4          -0.043953   0.182692  -0.241   0.8102  
## BI_S5          -0.142638   0.215252  -0.663   0.5085  
## autoconC        2.153725   2.617706   0.823   0.4118  
## nivel           0.050343   0.023190   2.171   0.0313 *
## TM              1.141248   0.580313   1.967   0.0509 .
## autoconC:nivel -0.025405   0.033248  -0.764   0.4459  
## autoconC:TM    -0.254747   1.016274  -0.251   0.8024  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.017723)
## 
##     Null deviance: 194.62  on 187  degrees of freedom
## Residual deviance: 158.07  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[17]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2909  -1.0611   0.5461   0.9679   1.8353  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     0.52733    1.52358   0.346   0.7297  
## EAC_S1         -0.07621    0.10102  -0.754   0.4517  
## EAC_S2          0.31328    0.12389   2.529   0.0124 *
## EAC_S3          0.18003    0.12386   1.453   0.1480  
## EAC_S4         -0.20001    0.14987  -1.335   0.1838  
## EAC_S5         -0.01855    0.15685  -0.118   0.9060  
## EAC_S6          0.22208    0.19150   1.160   0.2478  
## OE_S1           0.15714    0.11170   1.407   0.1613  
## OE_S2          -0.06050    0.14950  -0.405   0.6862  
## OE_S3          -0.24962    0.17820  -1.401   0.1631  
## BI_S1          -0.07319    0.10131  -0.722   0.4711  
## BI_S2           0.33042    0.14666   2.253   0.0256 *
## BI_S3           0.24799    0.14263   1.739   0.0839 .
## BI_S4          -0.20393    0.14936  -1.365   0.1739  
## BI_S5          -0.15357    0.14961  -1.026   0.3062  
## autoconC        0.34867    2.23532   0.156   0.8762  
## nivel          -0.01187    0.01976  -0.601   0.5488  
## TM              0.86772    0.46907   1.850   0.0661 .
## autoconC:nivel  0.02297    0.02765   0.831   0.4073  
## autoconC:TM    -2.38681    0.95374  -2.503   0.0133 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.11922)
## 
##     Null deviance: 258.49  on 187  degrees of freedom
## Residual deviance: 225.74  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[18]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.8583  -1.0234   0.6160   0.9516   1.9649  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     0.748943   1.535378   0.488   0.6263   
## EAC_S1         -0.002316   0.103204  -0.022   0.9821   
## EAC_S2          0.352510   0.123028   2.865   0.0047 **
## EAC_S3          0.083258   0.120756   0.689   0.4915   
## EAC_S4         -0.088046   0.146051  -0.603   0.5474   
## EAC_S5          0.115441   0.158164   0.730   0.4665   
## EAC_S6          0.099240   0.191235   0.519   0.6045   
## OE_S1           0.162381   0.108256   1.500   0.1355   
## OE_S2           0.176211   0.126386   1.394   0.1651   
## OE_S3          -0.094199   0.173123  -0.544   0.5871   
## BI_S1          -0.214260   0.099859  -2.146   0.0333 * 
## BI_S2           0.252106   0.141786   1.778   0.0772 . 
## BI_S3           0.119133   0.132792   0.897   0.3709   
## BI_S4          -0.167874   0.143393  -1.171   0.2434   
## BI_S5          -0.180359   0.149697  -1.205   0.2300   
## autoconC        1.707100   2.282693   0.748   0.4556   
## nivel          -0.010936   0.019814  -0.552   0.5817   
## TM              0.343575   0.455726   0.754   0.4520   
## autoconC:nivel  0.002351   0.027121   0.087   0.9310   
## autoconC:TM    -1.498878   0.958181  -1.564   0.1196   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.098885)
## 
##     Null deviance: 254.44  on 187  degrees of freedom
## Residual deviance: 224.08  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[19]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9230  -1.0253   0.4724   0.9241   2.0034  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -1.745408   1.562545  -1.117  0.26558   
## EAC_S1          0.022993   0.102110   0.225  0.82212   
## EAC_S2          0.356933   0.127764   2.794  0.00582 **
## EAC_S3          0.181854   0.125133   1.453  0.14801   
## EAC_S4         -0.165606   0.145366  -1.139  0.25623   
## EAC_S5         -0.149786   0.160445  -0.934  0.35187   
## EAC_S6          0.097857   0.186104   0.526  0.59971   
## OE_S1           0.245405   0.115496   2.125  0.03507 * 
## OE_S2          -0.149742   0.161873  -0.925  0.35626   
## OE_S3          -0.129956   0.181566  -0.716  0.47514   
## BI_S1          -0.170307   0.102079  -1.668  0.09710 . 
## BI_S2           0.282760   0.151289   1.869  0.06336 . 
## BI_S3           0.437964   0.156228   2.803  0.00565 **
## BI_S4          -0.047090   0.147875  -0.318  0.75054   
## BI_S5          -0.168258   0.150435  -1.118  0.26496   
## autoconC        3.106024   2.332846   1.331  0.18485   
## nivel           0.013600   0.020364   0.668  0.50516   
## TM              1.329495   0.490460   2.711  0.00741 **
## autoconC:nivel -0.004333   0.027920  -0.155  0.87685   
## autoconC:TM    -2.681261   0.995948  -2.692  0.00782 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.050221)
## 
##     Null deviance: 256.44  on 187  degrees of freedom
## Residual deviance: 213.99  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[20]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.8715  -0.8552   0.4509   0.8145   1.5974  
## 
## Coefficients:
##                 Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -1.780337   1.622610  -1.097  0.27412   
## EAC_S1          0.369038   0.140805   2.621  0.00957 **
## EAC_S2          0.144506   0.134736   1.073  0.28503   
## EAC_S3         -0.209269   0.148958  -1.405  0.16190   
## EAC_S4         -0.087756   0.178865  -0.491  0.62433   
## EAC_S5         -0.215299   0.186373  -1.155  0.24965   
## EAC_S6          0.078173   0.212901   0.367  0.71395   
## OE_S1          -0.001989   0.131228  -0.015  0.98793   
## OE_S2          -0.093522   0.147022  -0.636  0.52557   
## OE_S3          -0.397646   0.216561  -1.836  0.06810 . 
## BI_S1          -0.219286   0.130386  -1.682  0.09446 . 
## BI_S2           0.078742   0.178410   0.441  0.65953   
## BI_S3           0.523701   0.197990   2.645  0.00894 **
## BI_S4          -0.050225   0.166775  -0.301  0.76367   
## BI_S5          -0.230884   0.185477  -1.245  0.21493   
## autoconC       -1.821015   2.510170  -0.725  0.46918   
## nivel           0.026960   0.019436   1.387  0.16725   
## TM              0.524501   0.543528   0.965  0.33593   
## autoconC:nivel  0.031899   0.029439   1.084  0.28011   
## autoconC:TM     0.317939   0.998593   0.318  0.75059   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.27284)
## 
##     Null deviance: 229.00  on 187  degrees of freedom
## Residual deviance: 187.86  on 168  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5

Regressão linear com a soma das decisões

#-----------------------------------------------------------------------

# Agrega com a soma das decisões e média da confiança por
# indivíduo:aucoton.
dd <- db %>%
    group_by(Participantes, autocon) %>%
    summarise(acerto = sum(acerto),
              nivel = mean(nivel)) %>%
    ungroup() %>%
    full_join(da_scores)
## Joining, by = "Participantes"
# Ajuste com resultados agregados por unidade experimental.
fit <- lm(acerto ~
              EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
              OE_S1 + OE_S2 + OE_S3 +
              BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
              autocon * nivel,
          data = dd)

# Quadros para os testes dos efeitos de cada termo.
anova(fit)
## Analysis of Variance Table
## 
## Response: acerto
##               Df  Sum Sq Mean Sq F value  Pr(>F)  
## EAC_S1         1     5.7    5.72  0.0425 0.83731  
## EAC_S2         1   164.1  164.14  1.2187 0.27309  
## EAC_S3         1    75.4   75.36  0.5595 0.45677  
## EAC_S4         1    16.8   16.81  0.1248 0.72481  
## EAC_S5         1    13.3   13.26  0.0985 0.75455  
## EAC_S6         1    11.6   11.64  0.0864 0.76960  
## OE_S1          1   218.9  218.85  1.6250 0.20628  
## OE_S2          1    19.3   19.28  0.1431 0.70623  
## OE_S3          1   147.1  147.12  1.0923 0.29927  
## BI_S1          1   758.5  758.51  5.6319 0.02016 *
## BI_S2          1    36.2   36.16  0.2684 0.60588  
## BI_S3          1   227.8  227.80  1.6914 0.19735  
## BI_S4          1    56.2   56.21  0.4174 0.52019  
## BI_S5          1    41.8   41.79  0.3103 0.57914  
## autocon        1   220.2  220.22  1.6351 0.20489  
## nivel          1     0.0    0.00  0.0000 0.99974  
## autocon:nivel  1     3.0    2.96  0.0220 0.88257  
## Residuals     76 10235.8  134.68                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(fit, test = "F", scope = . ~ .)
## Single term deletions
## 
## Model:
## acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 + 
##     OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 + 
##     autocon * nivel
##               Df Sum of Sq   RSS    AIC F value  Pr(>F)  
## <none>                     10236 476.89                  
## EAC_S1         1    119.98 10356 475.99  0.8908 0.34825  
## EAC_S2         1    708.10 10944 481.18  5.2576 0.02462 *
## EAC_S3         1      3.18 10239 474.92  0.0236 0.87830  
## EAC_S4         1     13.11 10249 475.01  0.0974 0.75587  
## EAC_S5         1     11.09 10247 474.99  0.0824 0.77490  
## EAC_S6         1      6.54 10242 474.95  0.0486 0.82614  
## OE_S1          1    153.16 10389 476.29  1.1372 0.28962  
## OE_S2          1     40.46 10276 475.26  0.3004 0.58525  
## OE_S3          1    134.95 10371 476.12  1.0020 0.32000  
## BI_S1          1    636.76 10873 480.57  4.7279 0.03279 *
## BI_S2          1     32.56 10268 475.19  0.2418 0.62434  
## BI_S3          1    300.22 10536 477.61  2.2291 0.13957  
## BI_S4          1     41.27 10277 475.27  0.3065 0.58149  
## BI_S5          1     60.81 10297 475.45  0.4515 0.50364  
## autocon        1      0.03 10236 474.89  0.0002 0.98895  
## nivel          1      1.69 10238 474.91  0.0126 0.91110  
## autocon:nivel  1      2.96 10239 474.92  0.0220 0.88257  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Estimativas dos parâmetros.
summary(fit)
## 
## Call:
## lm(formula = acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + 
##     EAC_S6 + OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + 
##     BI_S4 + BI_S5 + autocon * nivel, data = dd)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -23.474  -8.682   2.634   7.515  20.026 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    25.71494   17.37758   1.480   0.1431  
## EAC_S1          0.68867    0.72966   0.944   0.3482  
## EAC_S2          1.84049    0.80268   2.293   0.0246 *
## EAC_S3         -0.13137    0.85507  -0.154   0.8783  
## EAC_S4         -0.31982    1.02497  -0.312   0.7559  
## EAC_S5         -0.31478    1.09684  -0.287   0.7749  
## EAC_S6         -0.28884    1.31040  -0.220   0.8261  
## OE_S1           0.81713    0.76625   1.066   0.2896  
## OE_S2           0.48331    0.88185   0.548   0.5853  
## OE_S3          -1.23040    1.22917  -1.001   0.3200  
## BI_S1          -1.54712    0.71152  -2.174   0.0328 *
## BI_S2           0.49204    1.00067   0.492   0.6243  
## BI_S3           1.35652    0.90857   1.493   0.1396  
## BI_S4          -0.56079    1.01300  -0.554   0.5815  
## BI_S5          -0.70583    1.05038  -0.672   0.5036  
## autoconC        0.28313   20.37068   0.014   0.9889  
## nivel          -0.02502    0.22337  -0.112   0.9111  
## autoconC:nivel  0.03868    0.26094   0.148   0.8826  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 11.61 on 76 degrees of freedom
## Multiple R-squared:  0.1645, Adjusted R-squared:  -0.02234 
## F-statistic: 0.8804 on 17 and 76 DF,  p-value: 0.598
# Avaliação dos pressupostos.
par(mfrow = c(2, 2))
plot(fit)

layout(1)

#-----------------------------------------------------------------------

Experimento 2

Leitura do arquivo de dados

#-----------------------------------------------------------------------
# Informações sobre os arquivos de dados.

rm(list = objects())

# BASE_EXPERIMENTO 2.txt -----------------------------------------------
# TM: acertou ou errou a tarefa de esgotamento.
# TLME: tarefa de livre manifestação escrita.
# D_*: são as decisões (0 ou 1).
# C_*: nível de confiança das decisões.
# BI_*: respostas para questões de business impusiviness.
# EAC_*: respostas para questões de escala de autocontrole.
# OE_*: orçamento empresarial.
# VI_*: verificação das intruções.

#-----------------------------------------------------------------------

# Exibe o conteúdo do diretório de trabalho.
dir()
## [1] "analise_files"           "analise.html"           
## [3] "analise.R"               "analise.Rmd"            
## [5] "BASE_EXPERIMENTO 1.txt"  "BASE_EXPERIMENTO 1.xlsx"
## [7] "BASE_EXPERIMENTO 2.txt"  "BASE_EXPERIMENTO 2.xlsx"
# Importa a base de dados.
da <- read_tsv("BASE_EXPERIMENTO 2.txt")
## Parsed with column specification:
## cols(
##   .default = col_integer(),
##   Participantes = col_character(),
##   Curso_F = col_character()
## )
## See spec(...) for full column specifications.
attr(da, "spec") <- NULL
str(da)
## Classes 'tbl_df', 'tbl' and 'data.frame':    60 obs. of  154 variables:
##  $ Participantes: chr  "S_A1" "S_A2" "S_A3" "S_A4" ...
##  $ TM           : int  0 0 0 0 0 1 0 0 0 0 ...
##  $ TLME         : int  1 1 1 0 1 0 0 0 1 1 ...
##  $ D_1          : int  0 0 0 0 0 1 1 0 0 1 ...
##  $ D_2          : int  0 1 1 0 1 1 1 1 1 0 ...
##  $ D_3          : int  0 0 1 0 1 1 1 1 1 0 ...
##  $ D_4          : int  1 1 1 1 1 1 1 1 1 0 ...
##  $ D_5          : int  0 1 1 1 1 1 1 0 1 1 ...
##  $ D_6          : int  0 1 1 1 0 1 1 0 0 0 ...
##  $ D_7          : int  0 1 1 1 1 1 1 0 0 0 ...
##  $ D_8          : int  0 0 0 0 1 1 1 0 1 0 ...
##  $ D_9          : int  1 0 1 1 1 1 1 1 1 1 ...
##  $ D_10         : int  0 0 1 1 1 1 1 0 1 0 ...
##  $ D_11         : int  0 1 1 1 1 1 1 0 0 1 ...
##  $ D_12         : int  1 0 1 1 1 0 1 1 1 1 ...
##  $ D_13         : int  0 0 1 1 1 1 1 0 1 1 ...
##  $ D_14         : int  1 0 1 1 0 1 1 0 1 0 ...
##  $ D_15         : int  0 0 1 1 0 1 1 0 1 1 ...
##  $ D_16         : int  0 0 1 1 1 1 1 1 1 1 ...
##  $ D_17         : int  1 1 1 1 0 0 1 0 1 0 ...
##  $ D_18         : int  0 1 1 1 1 0 1 0 1 0 ...
##  $ D_19         : int  0 1 1 1 0 1 1 0 1 0 ...
##  $ D_20         : int  1 0 1 1 1 1 1 0 1 1 ...
##  $ D_21         : int  0 1 1 1 0 1 1 0 1 0 ...
##  $ D_22         : int  0 1 1 1 1 0 1 0 1 0 ...
##  $ D_23         : int  1 0 1 1 1 0 1 0 1 0 ...
##  $ D_24         : int  1 0 1 1 0 1 1 0 1 0 ...
##  $ D_25         : int  1 0 1 1 1 0 1 1 1 1 ...
##  $ D_26         : int  0 1 1 1 0 1 1 1 1 0 ...
##  $ D_27         : int  0 0 1 1 0 0 1 1 1 0 ...
##  $ D_28         : int  0 0 1 1 0 1 1 1 1 0 ...
##  $ D_29         : int  1 0 1 1 1 1 1 1 1 1 ...
##  $ D_30         : int  0 1 1 0 1 1 1 1 1 0 ...
##  $ D_31         : int  0 1 1 1 1 1 1 0 1 0 ...
##  $ D_32         : int  1 0 1 1 0 1 1 0 1 1 ...
##  $ D_33         : int  0 0 1 1 0 1 1 0 1 0 ...
##  $ D_34         : int  0 1 1 1 0 0 1 0 1 0 ...
##  $ D_35         : int  0 1 1 1 0 1 1 0 1 0 ...
##  $ D_36         : int  1 0 1 1 0 1 1 1 1 1 ...
##  $ D_37         : int  0 0 1 1 0 1 1 0 1 0 ...
##  $ D_38         : int  0 1 1 1 1 1 1 0 1 0 ...
##  $ D_39         : int  0 0 1 1 0 1 1 0 1 0 ...
##  $ D_40         : int  1 1 0 0 1 1 1 1 1 1 ...
##  $ C_1          : int  10 6 7 8 10 9 9 9 10 7 ...
##  $ C_2          : int  9 8 7 6 9 9 10 7 9 8 ...
##  $ C_3          : int  9 8 7 9 10 9 10 5 9 8 ...
##  $ C_4          : int  9 8 8 9 8 9 10 5 8 6 ...
##  $ C_5          : int  9 8 8 7 8 9 10 5 9 6 ...
##  $ C_6          : int  9 8 7 8 8 9 10 9 9 8 ...
##  $ C_7          : int  9 8 7 9 8 9 10 9 9 7 ...
##  $ C_8          : int  9 9 7 6 8 9 10 10 8 8 ...
##  $ C_9          : int  9 7 8 7 8 9 10 6 9 6 ...
##  $ C_10         : int  9 7 7 7 7 9 10 8 8 7 ...
##  $ C_11         : int  9 6 8 7 7 9 10 7 9 7 ...
##  $ C_12         : int  9 7 8 8 7 9 10 5 9 7 ...
##  $ C_13         : int  9 6 8 7 7 9 10 8 9 6 ...
##  $ C_14         : int  9 6 8 7 9 9 10 7 9 7 ...
##  $ C_15         : int  9 6 8 7 9 9 10 8 8 7 ...
##  $ C_16         : int  9 8 8 8 7 9 10 5 9 8 ...
##  $ C_17         : int  9 6 8 8 7 9 10 7 8 8 ...
##  $ C_18         : int  9 6 8 8 7 9 10 7 9 7 ...
##  $ C_19         : int  9 6 8 8 8 9 10 8 9 6 ...
##  $ C_20         : int  9 6 8 8 8 9 10 6 9 8 ...
##  $ C_21         : int  9 6 7 7 7 9 10 7 8 7 ...
##  $ C_22         : int  9 5 8 7 8 9 10 8 7 7 ...
##  $ C_23         : int  9 7 8 7 7 9 10 6 8 7 ...
##  $ C_24         : int  9 6 8 7 7 9 10 6 8 8 ...
##  $ C_25         : int  9 7 8 7 6 9 10 5 8 7 ...
##  $ C_26         : int  9 7 8 7 8 9 10 8 8 8 ...
##  $ C_27         : int  9 8 8 7 8 9 10 8 8 7 ...
##  $ C_28         : int  9 6 7 7 9 9 10 8 8 6 ...
##  $ C_29         : int  9 6 8 7 6 9 10 8 8 7 ...
##  $ C_30         : int  9 7 8 7 6 9 10 8 8 7 ...
##  $ C_31         : int  9 7 6 8 6 9 10 7 8 7 ...
##  $ C_32         : int  9 7 7 8 7 9 10 6 8 8 ...
##  $ C_33         : int  9 6 7 9 8 9 10 8 8 7 ...
##  $ C_34         : int  9 5 7 7 7 9 10 8 8 7 ...
##  $ C_35         : int  9 6 7 7 7 9 10 7 8 8 ...
##  $ C_36         : int  9 6 7 8 8 9 10 5 8 7 ...
##  $ C_37         : int  9 7 7 8 7 9 10 7 8 7 ...
##  $ C_38         : int  9 6 7 8 7 9 10 7 8 8 ...
##  $ C_39         : int  9 6 7 8 7 9 10 7 8 7 ...
##  $ C_40         : int  9 6 7 5 7 9 10 5 8 8 ...
##  $ BI_1         : int  4 2 4 3 4 3 3 2 1 3 ...
##  $ BI_2         : int  1 3 1 1 2 1 2 3 4 2 ...
##  $ BI_3         : int  2 2 2 3 2 3 1 2 2 2 ...
##  $ BI_4         : int  2 1 1 2 1 1 1 1 1 2 ...
##  $ BI_5         : int  1 3 1 2 2 3 1 4 2 1 ...
##  $ BI_6         : int  1 2 2 3 3 1 1 2 4 2 ...
##  $ BI_7         : int  4 1 3 2 4 4 4 4 4 2 ...
##  $ BI_8         : int  3 3 3 3 2 3 3 2 4 3 ...
##  $ BI_9         : int  3 3 3 2 3 3 4 3 3 3 ...
##  $ BI_10        : int  2 1 3 3 3 3 3 3 2 3 ...
##  $ BI_11        : int  2 2 1 3 3 3 1 4 4 3 ...
##  $ BI_12        : int  4 2 4 3 3 1 4 1 2 3 ...
##  $ BI_13        : int  4 4 3 3 3 3 4 4 4 3 ...
##  $ BI_14        : int  1 3 1 1 2 3 1 4 4 2 ...
##  $ BI_15        : int  2 3 3 3 2 1 4 3 4 2 ...
##  $ BI_16        : int  1 1 2 1 1 1 2 1 1 1 ...
##   [list output truncated]
# Indivíduo com tuplas preenchimento errado.
da <- da %>%
    filter(Participantes != "S_C18")

# Criar o tratamento de autocontrole.
da$autocon <- da$Participantes %>%
    substr(start = 3, stop = 3) %>%
    as.factor()

#-----------------------------------------------------------------------
# Tabela que associa os nomes das questões que são as mesmas.

# Correspondência entre as decisões.
decis <- matrix(data = sprintf("%02d", 1:40), ncol = 2)

# Renomeia os números para ter dois digitos, então 1 fica 01.
names(da) <- names(da) %>%
    str_replace(pattern = "(.*)(_)(\\d)$",
                replacement = "\\1\\20\\3")

Análise de componentes principais

As variáveis de BI foram medidas para quantificar as diferenças sobre a impulsividade entre os participantes. Imagina-se que as respostas para as questões de BI possam ser explicadas por um conjunto pequeno de fatores latentes. O mesmo para OE e EAC. Para determinar o índice de impulsividade individual, será feita a análise de componentes principais com as respostas do questionário de BI. O número de componentes ideal a ser usado na análise de regressão será determinado depois.

Business impulsiviness

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis BI_*.

# Extrai e cria uma matriz com as variáveis de BI_*.
X <- da %>%
    select(contains("BI"))
dim(X)
## [1] 59 30
bi_basica <- X %>%
    gather(key = "BI", value = "valor") %>%
    group_by(BI) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(BI = str_replace(BI, "BI_", ""))

bi_basica %>%
    print(n = Inf)
## # A tibble: 30 x 7
##    BI        n média mediana desvpad mínimo máximo
##    <chr> <int> <dbl>   <int>   <dbl>  <dbl>  <dbl>
##  1 01       59  2.90       3   0.803      1      4
##  2 02       59  1.80       2   0.783      1      4
##  3 03       59  2.36       2   0.737      1      4
##  4 04       59  1.25       1   0.477      1      3
##  5 05       59  1.71       2   0.811      1      4
##  6 06       59  2.03       2   0.909      1      4
##  7 07       59  3.02       3   1.06       1      4
##  8 08       59  3.03       3   0.694      2      4
##  9 09       59  2.78       3   0.696      1      4
## 10 10       59  2.69       3   0.933      1      4
## 11 11       59  2.05       2   1.01       1      4
## 12 12       59  3.08       3   0.896      1      4
## 13 13       59  3.46       4   0.678      1      4
## 14 14       59  1.90       2   0.923      1      4
## 15 15       59  2.51       3   0.954      1      4
## 16 16       59  1.47       1   0.728      1      4
## 17 17       59  1.64       2   0.609      1      3
## 18 18       59  2.19       2   0.840      1      4
## 19 19       59  1.75       2   0.709      1      4
## 20 20       59  2.76       3   0.773      1      4
## 21 21       59  1.29       1   0.671      1      4
## 22 22       59  1.90       2   0.736      1      4
## 23 23       59  2.07       2   1.10       1      4
## 24 24       59  1.85       2   0.827      1      4
## 25 25       59  1.56       1   0.815      1      4
## 26 26       59  2.88       3   0.930      1      4
## 27 27       59  2.17       2   0.834      1      4
## 28 28       59  2.19       2   0.900      1      4
## 29 29       59  2.59       3   1.00       1      4
## 30 30       59  3.19       3   0.861      1      4
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(bi_basica, aes(x = BI, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Business impulsiviness") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 59 30
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("BI_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10
## 30                                     0.24  -0.46                       
## 09  0.28         -0.24         -0.32                                     
## 01  0.25          0.22                                            -0.23  
## 02 -0.24         -0.23         -0.33                       -0.25         
## 03         0.24  -0.22          0.33         -0.20  -0.32                
## 04                                    -0.38  -0.28                       
## 05                      -0.35          0.31         -0.26                
## 06 -0.29                 0.25                        0.22                
## 07         0.24         -0.31                              -0.22         
## 08         0.36                                                          
## 10         0.22   0.29                                                   
## 11         0.34                       -0.30                              
## 12  0.22          0.22                                     -0.27         
## 13                0.23  -0.21  -0.20         -0.29                       
## 14 -0.28   0.22                -0.32                                     
## 15         0.27          0.26  -0.27         -0.23  -0.27                
## 16                       0.27                 0.36  -0.25  -0.24         
## 17 -0.30                 0.21                                            
## 18                0.30  -0.25                       -0.21         -0.35  
## 19 -0.29                                                                 
## 20  0.23                              -0.29         -0.25                
## 21                0.30                -0.25   0.30  -0.32         -0.29  
## 22        -0.24                       -0.24  -0.21  -0.23                
## 23                0.28                        0.25   0.22   0.31   0.25  
## 24         0.21                        0.32                 0.33   0.41  
## 25                             -0.23   0.27         -0.36                
## 26         0.30                                             0.28         
## 27         0.25  -0.37   0.25                                            
## 28         0.28         -0.29                                            
## 29                                           -0.23          0.45  -0.41  
##    Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17 Comp.18 Comp.19
## 30  0.20                    0.24                           -0.26          
## 09                                                                        
## 01                  0.28            0.26   -0.26                          
## 02                                                  0.37                  
## 03                                         -0.21           -0.33   -0.21  
## 04 -0.31           -0.21    0.34                            0.29          
## 05         -0.35                                   -0.22    0.33          
## 06                                                                        
## 07                          0.31           -0.24                          
## 08         -0.24   -0.34   -0.28                                          
## 10  0.26                    0.33    0.25           -0.24    0.28          
## 11 -0.22                            0.27                                  
## 12         -0.33                                    0.39    0.23    0.33  
## 13 -0.37    0.23   -0.38   -0.34                                          
## 14                                                                        
## 15                                          0.34   -0.38                  
## 16                 -0.31            0.29                    0.22   -0.37  
## 17 -0.27                                   -0.23                          
## 18         -0.26           -0.26                                   -0.34  
## 19                                                          0.21          
## 20                  0.39   -0.24                            0.29          
## 21                 -0.22           -0.22   -0.22                    0.33  
## 22  0.30   -0.34                    0.30                                  
## 23         -0.44                                           -0.35          
## 24                                 -0.33   -0.21    0.24           -0.22  
## 25                                  0.45   -0.21                    0.24  
## 26                         -0.36                                    0.36  
## 27         -0.26                           -0.22   -0.22                  
## 28 -0.24            0.31                    0.45                          
## 29 -0.27                                    0.33                          
##    Comp.20 Comp.21 Comp.22 Comp.23 Comp.24 Comp.25 Comp.26 Comp.27 Comp.28
## 30                         -0.51                                          
## 09  0.30                                   -0.23           -0.37   -0.52  
## 01          0.44    0.23                   -0.22                    0.27  
## 02                                  0.22                            0.45  
## 03  0.22    0.32            0.24                           -0.20          
## 04                                  0.25                                  
## 05          0.22   -0.26                                                  
## 06                 -0.36    0.37           -0.29    0.22    0.26   -0.34  
## 07 -0.21    0.22            0.29    0.34    0.21    0.24                  
## 08  0.24   -0.22                                    0.24            0.23  
## 10         -0.25                   -0.21                                  
## 11                                                 -0.26    0.38          
## 12                                 -0.21    0.30                          
## 13                                                                        
## 14                         -0.20   -0.27                    0.26   -0.26  
## 15                                         -0.30   -0.25                  
## 16 -0.27                                                                  
## 17         -0.25   -0.21           -0.32                   -0.35    0.24  
## 18         -0.30                    0.25           -0.22                  
## 19  0.30            0.43                    0.49    0.34                  
## 20                 -0.40            0.29    0.30                          
## 21                                                  0.32                  
## 22 -0.43                           -0.27                                  
## 23                 -0.27                                                  
## 24 -0.24                    0.20                                          
## 25  0.24                                                                  
## 26          0.31                                   -0.29   -0.33          
## 27 -0.29                           -0.21            0.23                  
## 28                                                  0.38                  
## 29                          0.25            0.24                          
##    Comp.29 Comp.30
## 30                
## 09  0.20          
## 01                
## 02          0.35  
## 03                
## 04 -0.21          
## 05  0.25          
## 06                
## 07                
## 08         -0.45  
## 10 -0.26    0.23  
## 11  0.44          
## 12                
## 13          0.28  
## 14 -0.47          
## 15                
## 16                
## 17  0.25   -0.37  
## 18                
## 19                
## 20                
## 21          0.21  
## 22                
## 23                
## 24                
## 25 -0.33          
## 26                
## 27          0.33  
## 28 -0.22          
## 29                
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.03   0.03   0.03   0.03   0.03   0.03   0.03   0.03
## Cumulative Var   0.03   0.07   0.10   0.13   0.17   0.20   0.23   0.27
##                Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
## SS loadings      1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var   0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var   0.30    0.33    0.37    0.40    0.43    0.47    0.50
##                Comp.16 Comp.17 Comp.18 Comp.19 Comp.20 Comp.21 Comp.22
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var    0.53    0.57    0.60    0.63    0.67    0.70    0.73
##                Comp.23 Comp.24 Comp.25 Comp.26 Comp.27 Comp.28 Comp.29
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.03    0.03    0.03    0.03    0.03    0.03    0.03
## Cumulative Var    0.77    0.80    0.83    0.87    0.90    0.93    0.97
##                Comp.30
## SS loadings       1.00
## Proportion Var    0.03
## Cumulative Var    1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "BI_S")
# pairs(S[, 1:6])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Orçamento empresarial

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis OE_*.

# Extrai e cria uma matriz com as variáveis de OE_*.
X <- da %>%
    select(starts_with("OE"))

oe_basica <- X %>%
    gather(key = "OE", value = "valor") %>%
    group_by(OE) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(OE = str_replace(OE, "OE_", ""))

oe_basica %>%
    print(n = Inf)
## # A tibble: 9 x 7
##   OE        n média mediana desvpad mínimo máximo
##   <chr> <int> <dbl>   <int>   <dbl>  <dbl>  <dbl>
## 1 01       59  5.90       7   1.59       1      7
## 2 02       59  5.61       6   1.68       1      7
## 3 03       59  3.68       3   2.18       1      7
## 4 04       59  3.47       3   2.20       1      7
## 5 05       59  3.64       3   2.30       1      7
## 6 06       59  3.25       3   2.23       1      7
## 7 07       59  6.25       7   1.17       1      7
## 8 08       59  6.49       7   0.728      4      7
## 9 09       59  5.95       7   1.51       1      7
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(oe_basica, aes(x = OE, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Orçamento empresarial") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 59  9
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("OE_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9
## 01        -0.58   0.35                 0.47   0.42         -0.31 
## 02        -0.57   0.39   0.21         -0.47  -0.35  -0.24   0.27 
## 09               -0.46   0.84                                    
## 07        -0.39  -0.44  -0.28   0.70                             
## 08        -0.35  -0.54  -0.32  -0.61  -0.27                      
## 06 -0.46                        0.25  -0.46   0.52   0.40        
## 03 -0.47                       -0.26   0.25  -0.54   0.55        
## 05 -0.48                               0.33   0.20  -0.58   0.48 
## 04 -0.48                              -0.22         -0.32  -0.74 
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.11   0.11   0.11   0.11   0.11   0.11   0.11   0.11
## Cumulative Var   0.11   0.22   0.33   0.44   0.56   0.67   0.78   0.89
##                Comp.9
## SS loadings      1.00
## Proportion Var   0.11
## Cumulative Var   1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "OE_S")
# pairs(S[, 1:3])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Escala de autocontrole

#-----------------------------------------------------------------------
# Análise de componentes principais nas variáveis EAC_*.

# Extrai e cria uma matriz com as variáveis de EAC_*.
X <- da %>%
    select(starts_with("EAC"))

eac_basica <- X %>%
    gather(key = "EAC", value = "valor") %>%
    group_by(EAC) %>%
    summarise(n = n(),
              média = mean(valor),
              mediana = median(valor),
              desvpad = sd(valor),
              mínimo = min(valor),
              máximo = max(valor)) %>%
    mutate(EAC = str_replace(EAC, "EAC_", ""))

eac_basica %>%
    print(n = Inf)
## # A tibble: 24 x 7
##    EAC       n média mediana desvpad mínimo máximo
##    <chr> <int> <dbl>   <int>   <dbl>  <dbl>  <dbl>
##  1 01       59  1.32       1   0.681      1      4
##  2 02       59  1.14       1   0.434      1      3
##  3 03       59  1.36       1   0.637      1      3
##  4 04       59  1.59       1   0.912      1      4
##  5 05       59  2.59       3   1.15       1      4
##  6 06       59  2.37       2   1.17       1      4
##  7 07       59  1.41       1   0.790      1      4
##  8 08       59  1.98       2   1.11       1      4
##  9 09       59  1.63       1   0.908      1      4
## 10 10       59  2.42       2   1.10       1      4
## 11 11       59  2.19       2   1.07       1      4
## 12 12       59  2.68       3   1.17       1      4
## 13 13       59  2.42       2   1.15       1      4
## 14 14       59  2.17       2   1.12       1      4
## 15 15       59  1.51       1   0.935      1      4
## 16 16       59  1.51       1   0.878      1      4
## 17 17       59  1.56       1   0.915      1      4
## 18 18       59  1.61       1   0.891      1      4
## 19 19       59  2.07       2   1.08       1      4
## 20 20       59  1.49       1   0.838      1      4
## 21 21       59  2.14       2   1.15       1      4
## 22 22       59  1.76       1   0.989      1      4
## 23 23       59  1.41       1   0.619      1      3
## 24 24       59  1.76       1   0.935      1      4
# Gráfico com média e segmentos de erro para 1 desvio-padrão.
ggplot(eac_basica, aes(x = EAC, y = média)) +
    geom_point() +
    geom_errorbar(aes(ymin = média - desvpad,
                      ymax = média + desvpad),
                  width = 0.5) +
    xlab("Orçamento empresarial") +
    ylab(expression("Média" %+-% "desvio padrão")) +
    coord_flip()

# Cria a matriz para fazer a análise de componentes principais.
X <- X %>%
    as.matrix()
dim(X)
## [1] 59 24
# Renomeia para uma melhor exibição no biplot.
colnames(X) <- colnames(X) %>%
    str_replace("EAC_", "")

# Aplica componentes principais.
acp <- princomp(X, cor = TRUE)
# summary(acp)

# Exibe o resultado da ACP.
print(acp$loadings, digits = 2, cut = 0.2, sort = TRUE)
## 
## Loadings:
##    Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8 Comp.9 Comp.10
## 13 -0.21                                     -0.52   0.27                
## 23                0.22          0.25          0.33                 0.57  
## 10               -0.38                       -0.25                       
## 04               -0.23   0.39   0.22  -0.34         -0.27         -0.24  
## 06 -0.30                                                           0.22  
## 01         0.23         -0.40                       -0.24                
## 02         0.24         -0.40   0.30   0.23         -0.26   0.28  -0.20  
## 03                              0.26  -0.41                -0.44         
## 05 -0.23                       -0.27   0.22   0.27         -0.42         
## 07 -0.27                       -0.28                -0.21   0.22   0.28  
## 08 -0.25                       -0.46                -0.24                
## 09 -0.29                               0.22         -0.25                
## 11         0.33  -0.20   0.25   0.34   0.32                              
## 12 -0.21  -0.28         -0.25                -0.23                       
## 14 -0.20          0.35                               0.37                
## 15 -0.28   0.20                                      0.34                
## 16 -0.28                              -0.22          0.22   0.25         
## 17 -0.24                 0.30         -0.36                       -0.25  
## 18 -0.27                                             0.21   0.33  -0.30  
## 19        -0.21  -0.31   0.25          0.24   0.22          0.37         
## 20        -0.37                               0.40                       
## 21        -0.34                                     -0.20         -0.35  
## 22        -0.34   0.22                 0.26                              
## 24                0.46          0.27                -0.30                
##    Comp.11 Comp.12 Comp.13 Comp.14 Comp.15 Comp.16 Comp.17 Comp.18 Comp.19
## 13                                 -0.20                    0.22          
## 23                                 -0.25           -0.37                  
## 10  0.30    0.52                    0.26            0.25                  
## 04 -0.24                                    0.55            0.20          
## 06 -0.27           -0.21    0.30                                    0.31  
## 01 -0.23                           -0.29   -0.24    0.41                  
## 02                                          0.26                          
## 03         -0.28    0.30            0.36                                  
## 05                 -0.26           -0.22                           -0.27  
## 07 -0.34            0.39   -0.22                                    0.26  
## 08  0.30                            0.24    0.29                   -0.40  
## 09  0.36                   -0.40           -0.21                    0.43  
## 11                  0.28                                           -0.23  
## 12         -0.47   -0.37                                                  
## 14                         -0.23            0.31           -0.46          
## 15                 -0.24            0.47                            0.21  
## 16                          0.26           -0.25            0.41          
## 17                                                         -0.38          
## 18                 -0.23   -0.29                   -0.23                  
## 19 -0.22   -0.25                    0.23            0.35   -0.26          
## 20  0.21            0.24    0.36   -0.24    0.35    0.23            0.26  
## 21 -0.35            0.20    0.23    0.27           -0.27           -0.26  
## 22                         -0.38                    0.25    0.36          
## 24         -0.22   -0.25                            0.29                  
##    Comp.20 Comp.21 Comp.22 Comp.23 Comp.24
## 13                 -0.24   -0.45          
## 23                                  0.21  
## 10          0.27                          
## 04                                        
## 06  0.51            0.21                  
## 01                                  0.39  
## 02                 -0.33           -0.37  
## 03                                 -0.26  
## 05 -0.21           -0.22           -0.35  
## 07 -0.42            0.20                  
## 08  0.29                                  
## 09                                  0.26  
## 11 -0.23   -0.38    0.32                  
## 12 -0.27                    0.37          
## 14          0.27                          
## 15 -0.30           -0.24   -0.26    0.24  
## 16                          0.47          
## 17         -0.46   -0.25                  
## 18                  0.45                  
## 19                 -0.22                  
## 20                                        
## 21                                  0.29  
## 22         -0.39                          
## 24          0.23    0.35   -0.26          
## 
##                Comp.1 Comp.2 Comp.3 Comp.4 Comp.5 Comp.6 Comp.7 Comp.8
## SS loadings      1.00   1.00   1.00   1.00   1.00   1.00   1.00   1.00
## Proportion Var   0.04   0.04   0.04   0.04   0.04   0.04   0.04   0.04
## Cumulative Var   0.04   0.08   0.12   0.17   0.21   0.25   0.29   0.33
##                Comp.9 Comp.10 Comp.11 Comp.12 Comp.13 Comp.14 Comp.15
## SS loadings      1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var   0.04    0.04    0.04    0.04    0.04    0.04    0.04
## Cumulative Var   0.38    0.42    0.46    0.50    0.54    0.58    0.62
##                Comp.16 Comp.17 Comp.18 Comp.19 Comp.20 Comp.21 Comp.22
## SS loadings       1.00    1.00    1.00    1.00    1.00    1.00    1.00
## Proportion Var    0.04    0.04    0.04    0.04    0.04    0.04    0.04
## Cumulative Var    0.67    0.71    0.75    0.79    0.83    0.88    0.92
##                Comp.23 Comp.24
## SS loadings       1.00    1.00
## Proportion Var    0.04    0.04
## Cumulative Var    0.96    1.00
# Proporção de variância acumulada.
plot(cbind(x = 1:length(acp$sdev),
           y = c(cumsum(acp$sdev^2))/sum(acp$sdev^2)),
     type = "o",
     ylim = c(0, 1),
     xlab = "Componente",
     ylab = "Proporção de variância acumulada")
abline(h = c(0.5, 0.75, 0.9), lty = 2)

# Biplot.
biplot(acp, choices = c(1, 2))

# Escores para serem usados na regressão.
S <- acp$scores
colnames(S) <- str_replace(colnames(S), "Comp\\.", "EAC_S")
# pairs(S[, 1:3])

# Concatena os escores com as demais variáveis.
da <- cbind(da, S)

Análise exploratória das decisões

#-----------------------------------------------------------------------
# Gráficos.

# Proporção de acertos da tarefa das matrizes por grupo de autocontrole.
names(da)
##   [1] "Participantes" "TM"            "TLME"          "D_01"         
##   [5] "D_02"          "D_03"          "D_04"          "D_05"         
##   [9] "D_06"          "D_07"          "D_08"          "D_09"         
##  [13] "D_10"          "D_11"          "D_12"          "D_13"         
##  [17] "D_14"          "D_15"          "D_16"          "D_17"         
##  [21] "D_18"          "D_19"          "D_20"          "D_21"         
##  [25] "D_22"          "D_23"          "D_24"          "D_25"         
##  [29] "D_26"          "D_27"          "D_28"          "D_29"         
##  [33] "D_30"          "D_31"          "D_32"          "D_33"         
##  [37] "D_34"          "D_35"          "D_36"          "D_37"         
##  [41] "D_38"          "D_39"          "D_40"          "C_01"         
##  [45] "C_02"          "C_03"          "C_04"          "C_05"         
##  [49] "C_06"          "C_07"          "C_08"          "C_09"         
##  [53] "C_10"          "C_11"          "C_12"          "C_13"         
##  [57] "C_14"          "C_15"          "C_16"          "C_17"         
##  [61] "C_18"          "C_19"          "C_20"          "C_21"         
##  [65] "C_22"          "C_23"          "C_24"          "C_25"         
##  [69] "C_26"          "C_27"          "C_28"          "C_29"         
##  [73] "C_30"          "C_31"          "C_32"          "C_33"         
##  [77] "C_34"          "C_35"          "C_36"          "C_37"         
##  [81] "C_38"          "C_39"          "C_40"          "BI_01"        
##  [85] "BI_02"         "BI_03"         "BI_04"         "BI_05"        
##  [89] "BI_06"         "BI_07"         "BI_08"         "BI_09"        
##  [93] "BI_10"         "BI_11"         "BI_12"         "BI_13"        
##  [97] "BI_14"         "BI_15"         "BI_16"         "BI_17"        
## [101] "BI_18"         "BI_19"         "BI_20"         "BI_21"        
## [105] "BI_22"         "BI_23"         "BI_24"         "BI_25"        
## [109] "BI_26"         "BI_27"         "BI_28"         "BI_29"        
## [113] "BI_30"         "EAC_01"        "EAC_02"        "EAC_03"       
## [117] "EAC_04"        "EAC_05"        "EAC_06"        "EAC_07"       
## [121] "EAC_08"        "EAC_09"        "EAC_10"        "EAC_11"       
## [125] "EAC_12"        "EAC_13"        "EAC_14"        "EAC_15"       
## [129] "EAC_16"        "EAC_17"        "EAC_18"        "EAC_19"       
## [133] "EAC_20"        "EAC_21"        "EAC_22"        "EAC_23"       
## [137] "EAC_24"        "VI_01"         "VI_02"         "OE_01"        
## [141] "OE_02"         "OE_03"         "OE_04"         "OE_05"        
## [145] "OE_06"         "OE_07"         "OE_08"         "OE_09"        
## [149] "Gênero"        "Idade"         "Curso_F"       "Curso_Atual"  
## [153] "P_Curso"       "Turma"         "autocon"       "BI_S1"        
## [157] "BI_S2"         "BI_S3"         "BI_S4"         "BI_S5"        
## [161] "BI_S6"         "BI_S7"         "BI_S8"         "BI_S9"        
## [165] "BI_S10"        "BI_S11"        "BI_S12"        "BI_S13"       
## [169] "BI_S14"        "BI_S15"        "BI_S16"        "BI_S17"       
## [173] "BI_S18"        "BI_S19"        "BI_S20"        "BI_S21"       
## [177] "BI_S22"        "BI_S23"        "BI_S24"        "BI_S25"       
## [181] "BI_S26"        "BI_S27"        "BI_S28"        "BI_S29"       
## [185] "BI_S30"        "OE_S1"         "OE_S2"         "OE_S3"        
## [189] "OE_S4"         "OE_S5"         "OE_S6"         "OE_S7"        
## [193] "OE_S8"         "OE_S9"         "EAC_S1"        "EAC_S2"       
## [197] "EAC_S3"        "EAC_S4"        "EAC_S5"        "EAC_S6"       
## [201] "EAC_S7"        "EAC_S8"        "EAC_S9"        "EAC_S10"      
## [205] "EAC_S11"       "EAC_S12"       "EAC_S13"       "EAC_S14"      
## [209] "EAC_S15"       "EAC_S16"       "EAC_S17"       "EAC_S18"      
## [213] "EAC_S19"       "EAC_S20"       "EAC_S21"       "EAC_S22"      
## [217] "EAC_S23"       "EAC_S24"
da %>%
    group_by(autocon) %>%
    summarise(prop_TM = mean(TM),
              prop_TLME = mean(TLME))
## # A tibble: 2 x 3
##   autocon prop_TM prop_TLME
##   <fct>     <dbl>     <dbl>
## 1 A        0.0606     0.697
## 2 C        0.962      1
db <- list()

# Empilha as decisões.
db[[1]] <- da %>%
    select(Participantes, TM, TLME, autocon, starts_with("D_")) %>%
    gather(key = "decisoes", value = "acerto", contains("D_"))

# Empilha as confianças nas decisões.
db[[2]] <- da %>%
    select(Participantes, starts_with("C_")) %>%
    gather(key = "decisoes", value = "nivel", contains("C_")) %>%
    mutate(nivel = 10 * nivel)

# str(db[[1]])
# str(db[[2]])

# Remove os prefixos `D_` e `C_`.
db[[1]]$decisoes <- db[[1]]$decisoes %>% str_replace("D_", "")
db[[2]]$decisoes <- db[[2]]$decisoes %>% str_replace("C_", "")

# Junção da parte da decisões com as confianças.
db <- full_join(db[[1]], db[[2]])
## Joining, by = c("Participantes", "decisoes")
str(db)
## 'data.frame':    2360 obs. of  7 variables:
##  $ Participantes: chr  "S_A1" "S_A2" "S_A3" "S_A4" ...
##  $ TM           : int  0 0 0 0 0 1 0 0 0 0 ...
##  $ TLME         : int  1 1 1 0 1 0 0 0 1 1 ...
##  $ autocon      : Factor w/ 2 levels "A","C": 1 1 1 1 1 1 1 1 1 1 ...
##  $ decisoes     : chr  "01" "01" "01" "01" ...
##  $ acerto       : int  0 0 0 0 0 1 1 0 0 1 ...
##  $ nivel        : num  100 60 70 80 100 90 90 90 100 70 ...
# Renomeia para que D_21 seja D_01 e assim por diante.
u <- decis[match(x = db$decisoes,
                 table = decis[, 2],), 1]
db$decisoes[!is.na(u)] <- u[!is.na(u)]

# Passa para inteiro.
db$decisoes <- db$decisoes %>%
    as.integer()

# Obtém a estatística descritiva.
db_prop <- db %>%
    group_by(autocon, decisoes) %>%
    summarise(acerto_prop = mean(acerto),
              conf_média = mean(nivel),
              conf_sd = sd(nivel))

db_prop %>%
    print(n = Inf)
## # A tibble: 40 x 5
## # Groups:   autocon [?]
##    autocon decisoes acerto_prop conf_média conf_sd
##    <fct>      <int>       <dbl>      <dbl>   <dbl>
##  1 A              1       0.515       79.4    12.3
##  2 A              2       0.606       77.7    12.7
##  3 A              3       0.697       79.5    14.0
##  4 A              4       0.697       77.6    13.4
##  5 A              5       0.758       76.4    13.7
##  6 A              6       0.576       76.8    13.4
##  7 A              7       0.545       79.7    12.1
##  8 A              8       0.530       78.6    12.3
##  9 A              9       0.788       78.5    13.0
## 10 A             10       0.667       77.1    12.5
## 11 A             11       0.606       76.4    13.9
## 12 A             12       0.712       78.0    13.2
## 13 A             13       0.591       77.6    13.0
## 14 A             14       0.485       76.8    13.6
## 15 A             15       0.606       77.7    12.7
## 16 A             16       0.727       77.6    14.7
## 17 A             17       0.576       77.3    12.8
## 18 A             18       0.636       75.6    12.5
## 19 A             19       0.561       76.7    12.7
## 20 A             20       0.742       80.3    15.4
## 21 C              1       0.519       74.8    12.9
## 22 C              2       0.673       73.5    12.8
## 23 C              3       0.615       76.2    11.9
## 24 C              4       0.673       75.2    13.1
## 25 C              5       0.75        74.6    13.1
## 26 C              6       0.654       75.6    13.2
## 27 C              7       0.615       73.3    13.8
## 28 C              8       0.423       75.6    14.6
## 29 C              9       0.712       74.8    13.1
## 30 C             10       0.654       73.5    14.1
## 31 C             11       0.442       70.6    11.6
## 32 C             12       0.769       75.6    12.9
## 33 C             13       0.481       74.4    14.3
## 34 C             14       0.423       72.5    15.3
## 35 C             15       0.538       71.3    13.7
## 36 C             16       0.75        74.4    13.2
## 37 C             17       0.635       74.0    13.3
## 38 C             18       0.596       72.3    12.1
## 39 C             19       0.538       73.7    13.1
## 40 C             20       0.654       76.0    14.6
# Versão lado a lado para acerto.
db_prop %>%
    select(autocon, decisoes, acerto_prop) %>%
    spread(key = autocon, value = acerto_prop)
## # A tibble: 20 x 3
##    decisoes     A     C
##       <int> <dbl> <dbl>
##  1        1 0.515 0.519
##  2        2 0.606 0.673
##  3        3 0.697 0.615
##  4        4 0.697 0.673
##  5        5 0.758 0.75 
##  6        6 0.576 0.654
##  7        7 0.545 0.615
##  8        8 0.530 0.423
##  9        9 0.788 0.712
## 10       10 0.667 0.654
## 11       11 0.606 0.442
## 12       12 0.712 0.769
## 13       13 0.591 0.481
## 14       14 0.485 0.423
## 15       15 0.606 0.538
## 16       16 0.727 0.75 
## 17       17 0.576 0.635
## 18       18 0.636 0.596
## 19       19 0.561 0.538
## 20       20 0.742 0.654
# Versão lado a lado para confiança média.
db_prop %>%
    select(autocon, decisoes, conf_média) %>%
    spread(key = autocon, value = conf_média)
## # A tibble: 20 x 3
##    decisoes     A     C
##       <int> <dbl> <dbl>
##  1        1  79.4  74.8
##  2        2  77.7  73.5
##  3        3  79.5  76.2
##  4        4  77.6  75.2
##  5        5  76.4  74.6
##  6        6  76.8  75.6
##  7        7  79.7  73.3
##  8        8  78.6  75.6
##  9        9  78.5  74.8
## 10       10  77.1  73.5
## 11       11  76.4  70.6
## 12       12  78.0  75.6
## 13       13  77.6  74.4
## 14       14  76.8  72.5
## 15       15  77.7  71.3
## 16       16  77.6  74.4
## 17       17  77.3  74.0
## 18       18  75.6  72.3
## 19       19  76.7  73.7
## 20       20  80.3  76.0
gg1 <-
ggplot(db_prop,
       aes(x = autocon,
           y = acerto_prop,
           group = decisoes)) +
    geom_point() +
    geom_line() +
    geom_text(aes(x = (as.integer(autocon) +
                       0.075 * scale(as.integer(autocon))),
                  label = decisoes)) +
    ylab("Proporção de acerto") +
    xlab("Autocontrole")

gg2 <-
ggplot(db_prop,
       aes(x = autocon,
           y = conf_média,
           group = decisoes)) +
    geom_point() +
    # geom_point(aes(size = conf_sd)) +
    geom_line() +
    geom_text(aes(x = (as.integer(autocon) +
                       0.075 * scale(as.integer(autocon))),
                  label = decisoes)) +
    ylab("Confiança média") +
    xlab("Autocontrole")

grid.arrange(gg1, gg2, nrow = 1)

Regressão logística para cada decisão

#-----------------------------------------------------------------------
# Análise de regressão logística.

# Cria correspondência entre decisões.
decis <- "D_" %>%
    str_c(decis) %>%
    matrix(ncol = 2)

# Porção apenas com os escores da ACP.
da_scores <- da %>%
    select(Participantes,
           starts_with("BI_S"),
           starts_with("OE_S"),
           starts_with("EAC_S"))

# Coloca os escores ao lado das variáveis filtrando para a decisão.
dd <- db %>%
    filter(decisoes == 1) %>%
    full_join(da_scores)
## Joining, by = "Participantes"
# Ajuste do modelo.
fit <- glm(acerto ~
               EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
               OE_S1 + OE_S2 + OE_S3 +
               BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
               autocon * nivel +
               autocon * TM +
               TLME,
           data = dd,
           family = quasibinomial)

# anova(fit, test = "F")
drop1(fit, test = "F", scope = . ~ .)
## Single term deletions
## 
## Model:
## acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 + 
##     OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 + 
##     autocon * nivel + autocon * TM + TLME
##               Df Deviance F value  Pr(>F)  
## <none>             137.96                  
## EAC_S1         1   138.47  0.3596 0.55013  
## EAC_S2         1   140.29  1.6440 0.20283  
## EAC_S3         1   138.08  0.0898 0.76511  
## EAC_S4         1   138.58  0.4360 0.51061  
## EAC_S5         1   139.82  1.3102 0.25518  
## EAC_S6         1   140.81  2.0105 0.15942  
## OE_S1          1   138.19  0.1654 0.68509  
## OE_S2          1   138.59  0.4429 0.50732  
## OE_S3          1   139.10  0.8029 0.37244  
## BI_S1          1   142.06  2.8881 0.09244 .
## BI_S2          1   138.27  0.2228 0.63800  
## BI_S3          1   138.64  0.4798 0.49016  
## BI_S4          1   138.02  0.0469 0.82894  
## BI_S5          1   138.58  0.4366 0.51036  
## autocon        1   138.04  0.0595 0.80776  
## nivel          1   138.63  0.4762 0.49179  
## TM             1   146.01  5.6618 0.01930 *
## TLME           1   138.05  0.0642 0.80053  
## autocon:nivel  1   138.00  0.0319 0.85858  
## autocon:TM     1   143.19  3.6830 0.05791 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(fit)
## 
## Call:
## glm(formula = acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + 
##     EAC_S6 + OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + 
##     BI_S4 + BI_S5 + autocon * nivel + autocon * TM + TLME, family = quasibinomial, 
##     data = dd)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -1.84072  -1.05174   0.00036   0.95191   1.95251  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     1.502e+00  2.213e+00   0.679   0.4989  
## EAC_S1         -8.868e-02  1.348e-01  -0.658   0.5121  
## EAC_S2          2.674e-01  1.937e-01   1.380   0.1706  
## EAC_S3         -6.072e-02  1.832e-01  -0.331   0.7410  
## EAC_S4          1.428e-01  1.947e-01   0.734   0.4650  
## EAC_S5         -2.646e-01  2.116e-01  -1.251   0.2141  
## EAC_S6          3.690e-01  2.416e-01   1.527   0.1300  
## OE_S1          -6.834e-02  1.522e-01  -0.449   0.6544  
## OE_S2           1.351e-01  1.840e-01   0.734   0.4646  
## OE_S3          -2.043e-01  2.080e-01  -0.982   0.3284  
## BI_S1           2.381e-01  1.301e-01   1.831   0.0702 .
## BI_S2          -8.497e-02  1.619e-01  -0.525   0.6010  
## BI_S3          -1.436e-01  1.887e-01  -0.761   0.4487  
## BI_S4          -4.619e-02  1.926e-01  -0.240   0.8109  
## BI_S5          -1.461e-01  2.018e-01  -0.724   0.4710  
## autoconC        9.520e-01  3.529e+00   0.270   0.7879  
## nivel          -2.111e-02  2.791e-02  -0.756   0.4512  
## TM              1.782e+01  1.273e+03   0.014   0.9889  
## TLME           -2.241e-01  8.006e-01  -0.280   0.7802  
## autoconC:nivel  7.688e-03  3.893e-02   0.197   0.8439  
## autoconC:TM    -1.880e+01  1.273e+03  -0.015   0.9882  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.162731)
## 
##     Null deviance: 163.45  on 117  degrees of freedom
## Residual deviance: 137.96  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 15
# Fórmula do preditor linear que será usado em todas as decisões.
formula <- acerto ~
    EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
    OE_S1 + OE_S2 + OE_S3 +
    BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
    autocon * nivel +
    autocon * TM +
    TLME

# Ajustes em lote para cada decisão.
all_fits <- lapply(1:20,
                   FUN = function(i) {
                       dd <- db %>%
                           filter(decisoes == i) %>%
                           full_join(da_scores)
                       fit <- glm(formula = formula,
                                  data = dd,
                                  family = quasibinomial)
                       return(fit)
                   })
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
## Joining, by = "Participantes"
# lapply(all_fits, anova, test = "F")
# lapply(all_fits, drop1, test = "F", scope = . ~ .)
lapply(all_fits, summary)
## [[1]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -1.84072  -1.05174   0.00036   0.95191   1.95251  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     1.502e+00  2.213e+00   0.679   0.4989  
## EAC_S1         -8.868e-02  1.348e-01  -0.658   0.5121  
## EAC_S2          2.674e-01  1.937e-01   1.380   0.1706  
## EAC_S3         -6.072e-02  1.832e-01  -0.331   0.7410  
## EAC_S4          1.428e-01  1.947e-01   0.734   0.4650  
## EAC_S5         -2.646e-01  2.116e-01  -1.251   0.2141  
## EAC_S6          3.690e-01  2.416e-01   1.527   0.1300  
## OE_S1          -6.834e-02  1.522e-01  -0.449   0.6544  
## OE_S2           1.351e-01  1.840e-01   0.734   0.4646  
## OE_S3          -2.043e-01  2.080e-01  -0.982   0.3284  
## BI_S1           2.381e-01  1.301e-01   1.831   0.0702 .
## BI_S2          -8.497e-02  1.619e-01  -0.525   0.6010  
## BI_S3          -1.436e-01  1.887e-01  -0.761   0.4487  
## BI_S4          -4.619e-02  1.926e-01  -0.240   0.8109  
## BI_S5          -1.461e-01  2.018e-01  -0.724   0.4710  
## autoconC        9.520e-01  3.529e+00   0.270   0.7879  
## nivel          -2.111e-02  2.791e-02  -0.756   0.4512  
## TM              1.782e+01  1.273e+03   0.014   0.9889  
## TLME           -2.241e-01  8.006e-01  -0.280   0.7802  
## autoconC:nivel  7.688e-03  3.893e-02   0.197   0.8439  
## autoconC:TM    -1.880e+01  1.273e+03  -0.015   0.9882  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.162731)
## 
##     Null deviance: 163.45  on 117  degrees of freedom
## Residual deviance: 137.96  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 15
## 
## 
## [[2]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2209  -1.1874   0.6980   0.9445   1.5400  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)     1.637e+00  2.136e+00   0.767    0.445
## EAC_S1         -1.767e-01  1.446e-01  -1.222    0.225
## EAC_S2          2.208e-01  1.885e-01   1.172    0.244
## EAC_S3         -1.436e-01  1.851e-01  -0.776    0.440
## EAC_S4          1.054e-01  2.022e-01   0.521    0.603
## EAC_S5          1.846e-02  2.055e-01   0.090    0.929
## EAC_S6          1.066e-01  2.316e-01   0.461    0.646
## OE_S1          -5.580e-02  1.511e-01  -0.369    0.713
## OE_S2           2.741e-01  1.961e-01   1.398    0.165
## OE_S3          -1.453e-01  2.180e-01  -0.667    0.507
## BI_S1           5.087e-02  1.310e-01   0.388    0.699
## BI_S2          -1.357e-01  1.631e-01  -0.832    0.407
## BI_S3          -1.846e-02  1.988e-01  -0.093    0.926
## BI_S4           6.667e-02  1.804e-01   0.370    0.712
## BI_S5          -1.352e-01  2.121e-01  -0.637    0.525
## autoconC        1.449e+01  1.127e+03   0.013    0.990
## nivel          -5.263e-03  2.747e-02  -0.192    0.848
## TM              1.472e-01  1.384e+00   0.106    0.916
## TLME           -9.079e-01  7.995e-01  -1.136    0.259
## autoconC:nivel  1.632e-02  3.859e-02   0.423    0.673
## autoconC:TM    -1.559e+01  1.127e+03  -0.014    0.989
## 
## (Dispersion parameter for quasibinomial family taken to be 1.200088)
## 
##     Null deviance: 154.80  on 117  degrees of freedom
## Residual deviance: 140.82  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 14
## 
## 
## [[3]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0611  -0.9919   0.6019   0.8705   1.5114  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)
## (Intercept)    -1.39710    2.01046  -0.695    0.489
## EAC_S1          0.12978    0.14273   0.909    0.365
## EAC_S2          0.11501    0.19362   0.594    0.554
## EAC_S3          0.08069    0.17988   0.449    0.655
## EAC_S4          0.27427    0.22065   1.243    0.217
## EAC_S5         -0.32213    0.21034  -1.531    0.129
## EAC_S6         -0.17304    0.24115  -0.718    0.475
## OE_S1           0.06192    0.16183   0.383    0.703
## OE_S2           0.14463    0.20384   0.710    0.480
## OE_S3           0.28420    0.22371   1.270    0.207
## BI_S1           0.06948    0.13100   0.530    0.597
## BI_S2          -0.14239    0.16082  -0.885    0.378
## BI_S3           0.16713    0.20369   0.821    0.414
## BI_S4           0.09506    0.18717   0.508    0.613
## BI_S5          -0.22643    0.21297  -1.063    0.290
## autoconC        0.15086    3.72216   0.041    0.968
## nivel           0.02740    0.02635   1.040    0.301
## TM              1.14009    1.61503   0.706    0.482
## TLME            0.07595    0.80217   0.095    0.925
## autoconC:nivel -0.01328    0.04077  -0.326    0.745
## autoconC:TM    -0.32752    2.37939  -0.138    0.891
## 
## (Dispersion parameter for quasibinomial family taken to be 1.194377)
## 
##     Null deviance: 151.12  on 117  degrees of freedom
## Residual deviance: 131.05  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 4
## 
## 
## [[4]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4491  -0.9531   0.4566   0.8258   1.7800  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)
## (Intercept)    -1.381e+00  2.122e+00  -0.651    0.517
## EAC_S1         -1.629e-01  1.524e-01  -1.069    0.288
## EAC_S2          2.025e-01  2.044e-01   0.991    0.324
## EAC_S3          1.079e-01  1.821e-01   0.592    0.555
## EAC_S4          1.162e-01  2.119e-01   0.549    0.585
## EAC_S5         -2.534e-01  2.185e-01  -1.160    0.249
## EAC_S6          1.436e-01  2.487e-01   0.577    0.565
## OE_S1          -2.261e-02  1.823e-01  -0.124    0.902
## OE_S2           3.472e-01  2.152e-01   1.613    0.110
## OE_S3           2.378e-01  2.152e-01   1.105    0.272
## BI_S1          -1.292e-03  1.381e-01  -0.009    0.993
## BI_S2          -2.030e-01  1.870e-01  -1.086    0.280
## BI_S3          -4.816e-02  2.191e-01  -0.220    0.827
## BI_S4           2.320e-01  1.958e-01   1.185    0.239
## BI_S5          -1.024e-01  2.297e-01  -0.446    0.657
## autoconC       -2.068e+01  3.031e+03  -0.007    0.995
## nivel           4.493e-02  2.942e-02   1.527    0.130
## TM              1.710e+01  2.113e+03   0.008    0.994
## TLME           -1.469e+00  1.026e+00  -1.431    0.156
## autoconC:nivel  9.745e-03  4.531e-02   0.215    0.830
## autoconC:TM     3.264e+00  3.695e+03   0.001    0.999
## 
## (Dispersion parameter for quasibinomial family taken to be 1.173704)
## 
##     Null deviance: 146.77  on 117  degrees of freedom
## Residual deviance: 118.61  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[5]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.49282   0.06603   0.42076   0.70741   1.60878  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -2.41970    2.33831  -1.035   0.3033  
## EAC_S1          0.08013    0.17654   0.454   0.6509  
## EAC_S2          0.16772    0.23070   0.727   0.4690  
## EAC_S3         -0.07358    0.19998  -0.368   0.7137  
## EAC_S4          0.09653    0.23132   0.417   0.6774  
## EAC_S5         -0.48461    0.25753  -1.882   0.0629 .
## EAC_S6          0.28240    0.27817   1.015   0.3125  
## OE_S1          -0.26640    0.21303  -1.251   0.2141  
## OE_S2           0.29153    0.26815   1.087   0.2797  
## OE_S3          -0.28705    0.25857  -1.110   0.2697  
## BI_S1          -0.04113    0.16692  -0.246   0.8059  
## BI_S2          -0.32424    0.19575  -1.656   0.1009  
## BI_S3           0.50631    0.26859   1.885   0.0624 .
## BI_S4           0.01293    0.22209   0.058   0.9537  
## BI_S5          -0.03540    0.28777  -0.123   0.9023  
## autoconC        0.15316    3.79253   0.040   0.9679  
## nivel           0.06654    0.03324   2.001   0.0481 *
## TM             -1.74280    1.69298  -1.029   0.3058  
## TLME           -1.48658    1.10353  -1.347   0.1811  
## autoconC:nivel -0.00486    0.04446  -0.109   0.9132  
## autoconC:TM     2.49909    2.49925   1.000   0.3198  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.178895)
## 
##     Null deviance: 131.60  on 117  degrees of freedom
## Residual deviance: 104.31  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[6]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2585  -0.8239   0.2492   0.6980   1.9082  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)     8.495e-01  2.108e+00   0.403  0.68783   
## EAC_S1          1.541e-03  1.535e-01   0.010  0.99201   
## EAC_S2          4.825e-01  2.311e-01   2.088  0.03941 * 
## EAC_S3         -1.832e-02  1.997e-01  -0.092  0.92711   
## EAC_S4          5.531e-01  2.112e-01   2.618  0.01026 * 
## EAC_S5         -1.203e-01  2.161e-01  -0.557  0.57900   
## EAC_S6          5.644e-01  2.927e-01   1.928  0.05675 . 
## OE_S1           1.196e-01  1.705e-01   0.702  0.48466   
## OE_S2           5.281e-01  2.164e-01   2.440  0.01648 * 
## OE_S3           1.815e-02  2.243e-01   0.081  0.93567   
## BI_S1           1.901e-01  1.576e-01   1.206  0.23083   
## BI_S2          -4.409e-01  1.837e-01  -2.400  0.01829 * 
## BI_S3           8.198e-02  2.115e-01   0.388  0.69915   
## BI_S4          -4.357e-01  2.094e-01  -2.081  0.04011 * 
## BI_S5          -2.068e-01  2.452e-01  -0.843  0.40113   
## autoconC       -7.477e+00  2.841e+03  -0.003  0.99791   
## nivel           2.644e-02  2.739e-02   0.965  0.33689   
## TM              1.943e+01  1.616e+03   0.012  0.99043   
## TLME           -3.929e+00  1.179e+00  -3.331  0.00122 **
## autoconC:nivel -7.950e-02  4.048e-02  -1.964  0.05241 . 
## autoconC:TM    -3.664e+00  3.268e+03  -0.001  0.99911   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.031138)
## 
##     Null deviance: 157.81  on 117  degrees of freedom
## Residual deviance: 108.94  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[7]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0604  -1.0495   0.5525   0.9265   1.7826  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -3.155e-01  2.369e+00  -0.133   0.8943  
## EAC_S1          4.269e-02  1.325e-01   0.322   0.7480  
## EAC_S2          2.790e-01  1.873e-01   1.489   0.1397  
## EAC_S3         -1.071e-02  1.751e-01  -0.061   0.9514  
## EAC_S4          1.682e-01  1.902e-01   0.884   0.3787  
## EAC_S5         -2.576e-01  2.072e-01  -1.243   0.2168  
## EAC_S6          3.484e-01  2.389e-01   1.458   0.1480  
## OE_S1          -2.582e-04  1.583e-01  -0.002   0.9987  
## OE_S2           4.726e-01  2.019e-01   2.341   0.0213 *
## OE_S3           2.118e-02  2.060e-01   0.103   0.9183  
## BI_S1           1.287e-01  1.281e-01   1.004   0.3177  
## BI_S2          -2.066e-01  1.587e-01  -1.302   0.1961  
## BI_S3           7.091e-02  1.934e-01   0.367   0.7148  
## BI_S4           6.215e-03  1.827e-01   0.034   0.9729  
## BI_S5          -1.348e-01  2.162e-01  -0.624   0.5343  
## autoconC        1.875e+01  1.112e+03   0.017   0.9866  
## nivel           2.222e-02  2.832e-02   0.785   0.4346  
## TM              1.804e+00  1.549e+00   1.165   0.2470  
## TLME           -2.041e+00  8.816e-01  -2.315   0.0227 *
## autoconC:nivel -1.828e-02  3.852e-02  -0.474   0.6362  
## autoconC:TM    -1.795e+01  1.112e+03  -0.016   0.9872  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.166749)
## 
##     Null deviance: 160.83  on 117  degrees of freedom
## Residual deviance: 136.22  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 14
## 
## 
## [[8]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7100  -0.9232  -0.1568   1.0339   2.4228  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -1.995e+00  2.372e+00  -0.841   0.4026  
## EAC_S1          7.103e-02  1.333e-01   0.533   0.5952  
## EAC_S2          5.178e-01  2.229e-01   2.323   0.0222 *
## EAC_S3         -8.186e-02  1.819e-01  -0.450   0.6537  
## EAC_S4          4.087e-01  2.228e-01   1.835   0.0696 .
## EAC_S5         -8.694e-02  2.186e-01  -0.398   0.6917  
## EAC_S6          3.845e-01  2.619e-01   1.468   0.1453  
## OE_S1           4.908e-03  1.513e-01   0.032   0.9742  
## OE_S2           2.743e-01  1.999e-01   1.372   0.1732  
## OE_S3          -7.544e-02  2.064e-01  -0.366   0.7155  
## BI_S1          -3.683e-02  1.302e-01  -0.283   0.7780  
## BI_S2          -2.284e-01  1.669e-01  -1.368   0.1743  
## BI_S3           4.092e-01  2.126e-01   1.925   0.0571 .
## BI_S4          -7.564e-02  1.911e-01  -0.396   0.6931  
## BI_S5          -2.988e-02  2.123e-01  -0.141   0.8883  
## autoconC       -1.032e+01  3.018e+03  -0.003   0.9973  
## nivel           4.051e-02  3.048e-02   1.329   0.1870  
## TM              1.863e+01  1.974e+03   0.009   0.9925  
## TLME           -1.877e+00  8.545e-01  -2.196   0.0305 *
## autoconC:nivel -6.270e-02  4.065e-02  -1.542   0.1263  
## autoconC:TM    -2.981e+00  3.606e+03  -0.001   0.9993  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.163615)
## 
##     Null deviance: 163.45  on 117  degrees of freedom
## Residual deviance: 128.30  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[9]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.16246   0.00014   0.38840   0.72609   1.52235  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -2.996e-01  2.302e+00  -0.130   0.8967  
## EAC_S1          7.156e-02  1.435e-01   0.499   0.6190  
## EAC_S2          4.489e-01  2.003e-01   2.241   0.0273 *
## EAC_S3          3.046e-01  1.801e-01   1.691   0.0940 .
## EAC_S4          1.836e-01  2.307e-01   0.796   0.4280  
## EAC_S5         -4.448e-01  2.487e-01  -1.789   0.0768 .
## EAC_S6         -2.927e-01  2.542e-01  -1.152   0.2523  
## OE_S1           2.228e-01  1.743e-01   1.278   0.2042  
## OE_S2           6.332e-02  2.079e-01   0.305   0.7613  
## OE_S3           2.767e-01  2.358e-01   1.173   0.2436  
## BI_S1          -2.578e-01  1.472e-01  -1.752   0.0830 .
## BI_S2          -3.843e-01  1.664e-01  -2.309   0.0231 *
## BI_S3          -4.275e-03  2.462e-01  -0.017   0.9862  
## BI_S4           4.942e-01  2.186e-01   2.261   0.0260 *
## BI_S5          -1.530e-01  2.202e-01  -0.695   0.4887  
## autoconC        1.498e+01  2.749e+03   0.005   0.9957  
## nivel           3.197e-02  3.003e-02   1.064   0.2898  
## TM              1.801e+01  1.883e+03   0.010   0.9924  
## TLME           -6.245e-01  9.513e-01  -0.656   0.5131  
## autoconC:nivel -1.838e-02  3.903e-02  -0.471   0.6387  
## autoconC:TM    -3.215e+01  3.332e+03  -0.010   0.9923  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 0.9653502)
## 
##     Null deviance: 131.60  on 117  degrees of freedom
## Residual deviance: 104.32  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[10]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.9387  -1.0747   0.6083   0.8942   1.7294  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)      -0.86686    2.09526  -0.414   0.6800  
## EAC_S1           -0.06157    0.13284  -0.463   0.6441  
## EAC_S2            0.18882    0.19020   0.993   0.3233  
## EAC_S3            0.08743    0.17897   0.488   0.6263  
## EAC_S4            0.11644    0.18377   0.634   0.5278  
## EAC_S5            0.13036    0.21041   0.620   0.5370  
## EAC_S6            0.28115    0.25579   1.099   0.2744  
## OE_S1            -0.03776    0.15432  -0.245   0.8072  
## OE_S2             0.32446    0.19610   1.655   0.1012  
## OE_S3            -0.08016    0.19912  -0.403   0.6881  
## BI_S1             0.01484    0.13055   0.114   0.9097  
## BI_S2            -0.26728    0.16117  -1.658   0.1005  
## BI_S3             0.12543    0.19550   0.642   0.5227  
## BI_S4            -0.22263    0.17862  -1.246   0.2156  
## BI_S5             0.00853    0.21677   0.039   0.9687  
## autoconC         21.12922 2923.73670   0.007   0.9942  
## nivel             0.04219    0.02747   1.536   0.1279  
## TM               16.96438 1684.17036   0.010   0.9920  
## TLME             -2.21583    0.96234  -2.303   0.0234 *
## autoconC:nivel   -0.03229    0.03613  -0.894   0.3737  
## autoconC:TM     -35.13376 3374.11593  -0.010   0.9917  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.09233)
## 
##     Null deviance: 151.12  on 117  degrees of freedom
## Residual deviance: 129.27  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[11]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7658  -1.0600   0.3249   0.9183   2.0397  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -7.049e-01  1.776e+00  -0.397  0.69234   
## EAC_S1          3.079e-01  1.815e-01   1.696  0.09308 . 
## EAC_S2          1.660e-01  2.170e-01   0.765  0.44604   
## EAC_S3         -2.934e-01  1.821e-01  -1.611  0.11045   
## EAC_S4          2.238e-01  2.210e-01   1.013  0.31381   
## EAC_S5         -1.907e-01  2.069e-01  -0.922  0.35895   
## EAC_S6          1.977e-01  2.374e-01   0.833  0.40704   
## OE_S1          -2.357e-01  1.812e-01  -1.300  0.19660   
## OE_S2           2.257e-01  1.932e-01   1.168  0.24569   
## OE_S3          -8.648e-02  2.071e-01  -0.418  0.67719   
## BI_S1          -1.427e-01  1.386e-01  -1.030  0.30576   
## BI_S2          -5.782e-01  2.133e-01  -2.711  0.00794 **
## BI_S3           3.078e-01  1.957e-01   1.573  0.11894   
## BI_S4          -1.173e-01  1.898e-01  -0.618  0.53811   
## BI_S5          -5.702e-02  2.136e-01  -0.267  0.79002   
## autoconC       -1.446e+01  1.074e+03  -0.013  0.98929   
## nivel           2.642e-02  2.493e-02   1.060  0.29186   
## TM              1.367e+00  1.622e+00   0.843  0.40133   
## TLME           -1.342e+00  8.630e-01  -1.555  0.12327   
## autoconC:nivel -9.269e-06  3.868e-02   0.000  0.99981   
## autoconC:TM     1.310e+01  1.074e+03   0.012  0.99029   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.089808)
## 
##     Null deviance: 163.04  on 117  degrees of freedom
## Residual deviance: 130.06  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 14
## 
## 
## [[12]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.5028  -0.4450   0.2681   0.6651   1.7788  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)      -6.35196    2.86645  -2.216  0.02903 * 
## EAC_S1            0.06541    0.16622   0.393  0.69482   
## EAC_S2            0.25615    0.20561   1.246  0.21583   
## EAC_S3            0.27381    0.17848   1.534  0.12826   
## EAC_S4            0.20205    0.28219   0.716  0.47570   
## EAC_S5           -0.75537    0.28127  -2.686  0.00852 **
## EAC_S6           -0.46197    0.27135  -1.702  0.09187 . 
## OE_S1            -0.02286    0.19297  -0.118  0.90596   
## OE_S2             0.32120    0.25938   1.238  0.21858   
## OE_S3             0.09356    0.23400   0.400  0.69018   
## BI_S1            -0.35781    0.16705  -2.142  0.03471 * 
## BI_S2            -0.42776    0.17991  -2.378  0.01938 * 
## BI_S3             0.29117    0.28173   1.034  0.30392   
## BI_S4             0.66788    0.26507   2.520  0.01338 * 
## BI_S5             0.07767    0.23887   0.325  0.74578   
## autoconC         16.39723 1673.13858   0.010  0.99220   
## nivel             0.10038    0.04025   2.494  0.01432 * 
## TM                0.99427    2.05469   0.484  0.62955   
## TLME              0.63376    0.94727   0.669  0.50506   
## autoconC:nivel   -0.05995    0.04752  -1.261  0.21015   
## autoconC:TM     -13.24678 1673.13651  -0.008  0.99370   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 0.972376)
## 
##     Null deviance: 135.906  on 117  degrees of freedom
## Residual deviance:  95.942  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 15
## 
## 
## [[13]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##      Min        1Q    Median        3Q       Max  
## -2.04485  -0.97851   0.00025   0.86180   2.09643  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     3.199e+00  2.391e+00   1.338   0.1841  
## EAC_S1          3.524e-02  1.312e-01   0.269   0.7887  
## EAC_S2          2.816e-01  1.962e-01   1.435   0.1544  
## EAC_S3          2.415e-02  1.807e-01   0.134   0.8940  
## EAC_S4          9.632e-03  1.932e-01   0.050   0.9603  
## EAC_S5         -4.696e-01  2.317e-01  -2.027   0.0454 *
## EAC_S6          1.851e-01  2.373e-01   0.780   0.4374  
## OE_S1          -4.603e-03  1.615e-01  -0.028   0.9773  
## OE_S2           3.168e-01  2.007e-01   1.578   0.1177  
## OE_S3           5.869e-02  2.184e-01   0.269   0.7887  
## BI_S1           6.592e-02  1.305e-01   0.505   0.6146  
## BI_S2          -2.647e-01  1.665e-01  -1.590   0.1151  
## BI_S3           1.361e-01  2.103e-01   0.647   0.5190  
## BI_S4          -3.522e-02  1.972e-01  -0.179   0.8586  
## BI_S5           4.969e-02  2.075e-01   0.239   0.8113  
## autoconC        1.896e+01  3.057e+03   0.006   0.9951  
## nivel          -2.554e-02  2.949e-02  -0.866   0.3886  
## TM              1.807e+01  2.130e+03   0.008   0.9932  
## TLME           -1.355e+00  8.718e-01  -1.555   0.1233  
## autoconC:nivel -7.481e-03  4.040e-02  -0.185   0.8535  
## autoconC:TM    -3.666e+01  3.726e+03  -0.010   0.9922  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.194115)
## 
##     Null deviance: 162.73  on 117  degrees of freedom
## Residual deviance: 128.57  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[14]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.6914  -0.8312  -0.4875   0.8090   2.0309  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)    
## (Intercept)    -2.40478    2.17452  -1.106 0.271509    
## EAC_S1         -0.06382    0.15440  -0.413 0.680285    
## EAC_S2          0.01761    0.20119   0.088 0.930430    
## EAC_S3          0.17986    0.20432   0.880 0.380881    
## EAC_S4          0.18972    0.20808   0.912 0.364162    
## EAC_S5         -0.35217    0.23979  -1.469 0.145164    
## EAC_S6          0.32045    0.27042   1.185 0.238922    
## OE_S1          -0.03130    0.17142  -0.183 0.855477    
## OE_S2           0.81845    0.23397   3.498 0.000709 ***
## OE_S3          -0.22825    0.23195  -0.984 0.327543    
## BI_S1           0.04659    0.14544   0.320 0.749413    
## BI_S2          -0.10974    0.16872  -0.650 0.516958    
## BI_S3          -0.02782    0.21905  -0.127 0.899215    
## BI_S4           0.02199    0.19010   0.116 0.908167    
## BI_S5           0.27168    0.21658   1.254 0.212724    
## autoconC        7.24058    3.29443   2.198 0.030341 *  
## nivel           0.04536    0.02885   1.572 0.119153    
## TM              0.93457    1.57703   0.593 0.554818    
## TLME           -1.62703    0.86385  -1.883 0.062634 .  
## autoconC:nivel -0.08552    0.04013  -2.131 0.035604 *  
## autoconC:TM    -1.61709    2.39603  -0.675 0.501343    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.164237)
## 
##     Null deviance: 162.73  on 117  degrees of freedom
## Residual deviance: 123.88  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[15]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.2062  -0.9152   0.3225   0.8804   2.7738  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     8.877e-01  2.923e+00   0.304   0.7620  
## EAC_S1          8.085e-02  1.604e-01   0.504   0.6153  
## EAC_S2          3.893e-01  2.449e-01   1.590   0.1151  
## EAC_S3          2.702e-01  2.521e-01   1.072   0.2864  
## EAC_S4          1.497e-01  2.226e-01   0.673   0.5027  
## EAC_S5         -4.415e-01  2.815e-01  -1.568   0.1200  
## EAC_S6          8.949e-01  3.611e-01   2.479   0.0149 *
## OE_S1          -1.514e-01  1.826e-01  -0.829   0.4092  
## OE_S2           2.492e-01  2.266e-01   1.100   0.2741  
## OE_S3           2.056e-01  2.753e-01   0.747   0.4570  
## BI_S1          -7.890e-02  1.676e-01  -0.471   0.6389  
## BI_S2          -3.607e-01  1.919e-01  -1.879   0.0632 .
## BI_S3          -1.757e-01  2.459e-01  -0.714   0.4767  
## BI_S4           2.151e-01  2.431e-01   0.885   0.3784  
## BI_S5          -1.145e-03  2.483e-01  -0.005   0.9963  
## autoconC        1.891e+01  3.377e+03   0.006   0.9955  
## nivel          -7.171e-03  3.744e-02  -0.192   0.8485  
## TM              1.903e+01  2.389e+03   0.008   0.9937  
## TLME           -3.069e-01  9.956e-01  -0.308   0.7585  
## autoconC:nivel -3.259e-02  4.775e-02  -0.682   0.4966  
## autoconC:TM    -3.526e+01  4.137e+03  -0.009   0.9932  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.468892)
## 
##     Null deviance: 160.83  on 117  degrees of freedom
## Residual deviance: 122.64  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[16]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.4335  -0.5545   0.4067   0.7360   1.4507  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     1.769e+00  2.274e+00   0.778   0.4385  
## EAC_S1          8.291e-02  1.649e-01   0.503   0.6162  
## EAC_S2          1.963e-01  2.087e-01   0.941   0.3493  
## EAC_S3          8.591e-02  1.797e-01   0.478   0.6336  
## EAC_S4          2.646e-01  2.428e-01   1.090   0.2785  
## EAC_S5         -6.566e-01  2.757e-01  -2.382   0.0192 *
## EAC_S6         -2.355e-01  2.617e-01  -0.900   0.3704  
## OE_S1          -1.319e-01  2.176e-01  -0.606   0.5457  
## OE_S2           5.960e-01  2.791e-01   2.135   0.0353 *
## OE_S3           1.456e-01  2.464e-01   0.591   0.5560  
## BI_S1          -1.806e-01  1.498e-01  -1.206   0.2307  
## BI_S2          -2.942e-01  1.771e-01  -1.661   0.1000 .
## BI_S3           1.646e-01  2.542e-01   0.648   0.5188  
## BI_S4           3.086e-01  2.166e-01   1.425   0.1574  
## BI_S5           2.147e-01  2.404e-01   0.893   0.3739  
## autoconC        1.235e+01  2.948e+03   0.004   0.9967  
## nivel           5.061e-03  2.928e-02   0.173   0.8631  
## TM              1.753e+01  2.079e+03   0.008   0.9933  
## TLME           -1.252e+00  1.002e+00  -1.249   0.2146  
## autoconC:nivel  5.225e-02  4.664e-02   1.120   0.2653  
## autoconC:TM    -3.333e+01  3.608e+03  -0.009   0.9926  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.126166)
## 
##     Null deviance: 135.91  on 117  degrees of freedom
## Residual deviance: 103.84  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[17]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0744  -1.0535   0.4907   0.9555   2.1472  
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)    -0.67329    2.14342  -0.314   0.7541  
## EAC_S1         -0.06936    0.14678  -0.473   0.6376  
## EAC_S2          0.22951    0.20635   1.112   0.2688  
## EAC_S3          0.22234    0.20350   1.093   0.2773  
## EAC_S4          0.17500    0.19118   0.915   0.3623  
## EAC_S5         -0.16813    0.21396  -0.786   0.4339  
## EAC_S6          0.62434    0.28382   2.200   0.0302 *
## OE_S1          -0.18798    0.16406  -1.146   0.2547  
## OE_S2           0.44956    0.21340   2.107   0.0377 *
## OE_S3           0.08278    0.21827   0.379   0.7053  
## BI_S1           0.03311    0.14804   0.224   0.8235  
## BI_S2          -0.36375    0.16610  -2.190   0.0309 *
## BI_S3           0.09273    0.20611   0.450   0.6538  
## BI_S4           0.04677    0.18826   0.248   0.8043  
## BI_S5           0.08605    0.22948   0.375   0.7085  
## autoconC        5.05975    3.55032   1.425   0.1573  
## nivel           0.02233    0.02714   0.823   0.4127  
## TM              1.40815    1.55224   0.907   0.3666  
## TLME           -1.10994    0.87863  -1.263   0.2095  
## autoconC:nivel -0.05781    0.04020  -1.438   0.1536  
## autoconC:TM    -1.21666    2.38162  -0.511   0.6106  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.178309)
## 
##     Null deviance: 158.67  on 117  degrees of freedom
## Residual deviance: 131.41  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 5
## 
## 
## [[18]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.0707  -1.0346   0.4356   0.9421   1.8085  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     3.802e-01  2.058e+00   0.185   0.8538  
## EAC_S1         -9.818e-03  1.424e-01  -0.069   0.9452  
## EAC_S2          2.769e-01  1.902e-01   1.456   0.1487  
## EAC_S3          5.887e-02  1.796e-01   0.328   0.7438  
## EAC_S4          2.179e-01  1.885e-01   1.156   0.2506  
## EAC_S5         -4.042e-01  2.187e-01  -1.848   0.0676 .
## EAC_S6          3.569e-01  2.461e-01   1.450   0.1502  
## OE_S1          -2.329e-01  1.661e-01  -1.402   0.1640  
## OE_S2           4.815e-01  2.158e-01   2.232   0.0279 *
## OE_S3          -1.946e-01  2.150e-01  -0.905   0.3676  
## BI_S1          -7.051e-03  1.384e-01  -0.051   0.9595  
## BI_S2          -2.479e-01  1.584e-01  -1.565   0.1208  
## BI_S3           6.042e-02  2.023e-01   0.299   0.7659  
## BI_S4           9.880e-02  1.794e-01   0.551   0.5830  
## BI_S5           2.127e-01  2.234e-01   0.952   0.3435  
## autoconC        1.617e+01  1.108e+03   0.015   0.9884  
## nivel           1.429e-02  2.795e-02   0.512   0.6102  
## TM              9.756e-01  1.490e+00   0.655   0.5141  
## TLME           -1.174e+00  8.752e-01  -1.341   0.1830  
## autoconC:nivel  1.029e-04  4.278e-02   0.002   0.9981  
## autoconC:TM    -1.694e+01  1.108e+03  -0.015   0.9878  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.159268)
## 
##     Null deviance: 156.87  on 117  degrees of freedom
## Residual deviance: 132.92  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 14
## 
## 
## [[19]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -1.7878  -0.8837   0.0896   0.8035   2.0781  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)   
## (Intercept)    -5.297e+00  2.501e+00  -2.118  0.03673 * 
## EAC_S1          5.431e-02  1.368e-01   0.397  0.69221   
## EAC_S2          5.137e-01  2.072e-01   2.479  0.01489 * 
## EAC_S3         -5.978e-02  1.833e-01  -0.326  0.74504   
## EAC_S4          5.268e-01  2.135e-01   2.468  0.01534 * 
## EAC_S5         -2.427e-01  2.235e-01  -1.086  0.28022   
## EAC_S6          3.995e-01  2.573e-01   1.552  0.12381   
## OE_S1           2.246e-02  1.616e-01   0.139  0.88971   
## OE_S2           5.493e-01  2.012e-01   2.730  0.00753 **
## OE_S3           2.830e-02  2.087e-01   0.136  0.89242   
## BI_S1           9.407e-03  1.372e-01   0.069  0.94548   
## BI_S2          -4.753e-01  1.778e-01  -2.674  0.00881 **
## BI_S3          -1.999e-01  1.988e-01  -1.006  0.31715   
## BI_S4           1.481e-01  1.913e-01   0.774  0.44091   
## BI_S5          -5.310e-02  2.305e-01  -0.230  0.81828   
## autoconC        2.711e+01  2.896e+03   0.009  0.99255   
## nivel           8.636e-02  3.381e-02   2.554  0.01221 * 
## TM              1.999e+01  1.881e+03   0.011  0.99155   
## TLME           -1.873e+00  9.233e-01  -2.029  0.04524 * 
## autoconC:nivel -1.170e-01  4.444e-02  -2.633  0.00986 **
## autoconC:TM    -3.747e+01  3.453e+03  -0.011  0.99137   
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.077767)
## 
##     Null deviance: 162.36  on 117  degrees of freedom
## Residual deviance: 121.10  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 16
## 
## 
## [[20]]
## 
## Call:
## glm(formula = formula, family = quasibinomial, data = dd)
## 
## Deviance Residuals: 
##     Min       1Q   Median       3Q      Max  
## -2.1489  -0.9233   0.4696   0.8433   1.6914  
## 
## Coefficients:
##                  Estimate Std. Error t value Pr(>|t|)  
## (Intercept)      -4.38639    2.10839  -2.080   0.0401 *
## EAC_S1           -0.22213    0.16061  -1.383   0.1698  
## EAC_S2            0.01212    0.18928   0.064   0.9491  
## EAC_S3            0.13077    0.17714   0.738   0.4622  
## EAC_S4            0.22225    0.23081   0.963   0.3380  
## EAC_S5           -0.28520    0.21963  -1.299   0.1972  
## EAC_S6            0.06824    0.24788   0.275   0.7837  
## OE_S1            -0.32946    0.19115  -1.724   0.0880 .
## OE_S2             0.19143    0.21004   0.911   0.3643  
## OE_S3            -0.04245    0.21288  -0.199   0.8423  
## BI_S1            -0.05759    0.14882  -0.387   0.6996  
## BI_S2            -0.15926    0.16651  -0.956   0.3412  
## BI_S3             0.30924    0.25573   1.209   0.2295  
## BI_S4             0.02213    0.20198   0.110   0.9130  
## BI_S5            -0.35213    0.23802  -1.479   0.1423  
## autoconC          2.42033    3.02829   0.799   0.4261  
## nivel             0.06995    0.02815   2.485   0.0147 *
## TM               14.37177 1231.63471   0.012   0.9907  
## TLME              0.36196    0.99365   0.364   0.7164  
## autoconC:nivel   -0.06247    0.03436  -1.818   0.0721 .
## autoconC:TM     -12.43622 1231.63605  -0.010   0.9920  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## (Dispersion parameter for quasibinomial family taken to be 1.077699)
## 
##     Null deviance: 143.48  on 117  degrees of freedom
## Residual deviance: 116.03  on  97  degrees of freedom
## AIC: NA
## 
## Number of Fisher Scoring iterations: 15

Regressão linear com a soma das decisões

#-----------------------------------------------------------------------

# Agrega com a soma das decisões e média da confiança por
# indivíduo:aucoton.
dd <- db %>%
    group_by(Participantes, autocon) %>%
    summarise(acerto = sum(acerto),
              nivel = mean(nivel),
              TM = mean(TM),
              TLME = mean(TLME)) %>%
    ungroup() %>%
    full_join(da_scores)
## Joining, by = "Participantes"
# Ajuste com resultados agregados por unidade experimental.
fit <- lm(acerto ~
              EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 +
              OE_S1 + OE_S2 + OE_S3 +
              BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 +
              autocon * nivel + TM + TLME,
          data = dd)

# Quadros para os testes dos efeitos de cada termo.
anova(fit)
## Analysis of Variance Table
## 
## Response: acerto
##               Df Sum Sq Mean Sq F value  Pr(>F)  
## EAC_S1         1    2.9    2.91  0.0254 0.87410  
## EAC_S2         1   24.5   24.51  0.2139 0.64628  
## EAC_S3         1   91.6   91.61  0.7996 0.37669  
## EAC_S4         1   16.5   16.52  0.1442 0.70624  
## EAC_S5         1  296.2  296.21  2.5856 0.11591  
## EAC_S6         1   52.1   52.15  0.4552 0.50387  
## OE_S1          1  142.3  142.26  1.2418 0.27195  
## OE_S2          1  466.7  466.68  4.0735 0.05048 .
## OE_S3          1   15.9   15.90  0.1388 0.71153  
## BI_S1          1    3.8    3.82  0.0333 0.85612  
## BI_S2          1  266.8  266.77  2.3286 0.13509  
## BI_S3          1   23.9   23.90  0.2087 0.65036  
## BI_S4          1    7.7    7.69  0.0671 0.79693  
## BI_S5          1    6.2    6.20  0.0542 0.81719  
## autocon        1    2.5    2.46  0.0215 0.88419  
## nivel          1  201.8  201.77  1.7612 0.19219  
## TM             1  164.6  164.62  1.4369 0.23787  
## TLME           1  240.2  240.23  2.0969 0.15559  
## autocon:nivel  1  113.4  113.43  0.9901 0.32586  
## Residuals     39 4467.9  114.56                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
drop1(fit, test = "F", scope = . ~ .)
## Single term deletions
## 
## Model:
## acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + EAC_S6 + 
##     OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + BI_S4 + BI_S5 + 
##     autocon * nivel + TM + TLME
##               Df Sum of Sq    RSS    AIC F value  Pr(>F)  
## <none>                     4467.9 295.30                  
## EAC_S1         1      0.85 4468.8 293.31  0.0074 0.93178  
## EAC_S2         1    221.61 4689.6 296.16  1.9344 0.17216  
## EAC_S3         1      1.12 4469.1 293.32  0.0098 0.92161  
## EAC_S4         1    115.50 4583.4 294.81  1.0081 0.32154  
## EAC_S5         1    378.23 4846.2 298.10  3.3015 0.07691 .
## EAC_S6         1    106.34 4574.3 294.69  0.9282 0.34126  
## OE_S1          1      1.98 4469.9 293.33  0.0173 0.89618  
## OE_S2          1    560.34 5028.3 300.27  4.8911 0.03292 *
## OE_S3          1      0.17 4468.1 293.30  0.0015 0.96905  
## BI_S1          1     17.36 4485.3 293.53  0.1515 0.69923  
## BI_S2          1    455.31 4923.2 299.03  3.9743 0.05323 .
## BI_S3          1     32.09 4500.0 293.72  0.2801 0.59962  
## BI_S4          1     24.02 4492.0 293.62  0.2096 0.64960  
## BI_S5          1      1.92 4469.9 293.33  0.0168 0.89754  
## autocon        1     53.31 4521.2 294.00  0.4653 0.49918  
## nivel          1    304.60 4772.5 297.19  2.6588 0.11103  
## TM             1    153.46 4621.4 295.29  1.3396 0.25415  
## TLME           1    267.17 4735.1 296.73  2.3321 0.13480  
## autocon:nivel  1    113.43 4581.4 294.78  0.9901 0.32586  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
# Estimativas dos parâmetros.
summary(fit)
## 
## Call:
## lm(formula = acerto ~ EAC_S1 + EAC_S2 + EAC_S3 + EAC_S4 + EAC_S5 + 
##     EAC_S6 + OE_S1 + OE_S2 + OE_S3 + BI_S1 + BI_S2 + BI_S3 + 
##     BI_S4 + BI_S5 + autocon * nivel + TM + TLME, data = dd)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -17.711  -5.937  -0.727   5.863  19.071 
## 
## Coefficients:
##                Estimate Std. Error t value Pr(>|t|)  
## (Intercept)     2.12654   16.80869   0.127   0.9000  
## EAC_S1          0.07077    0.82140   0.086   0.9318  
## EAC_S2          1.57492    1.13235   1.391   0.1722  
## EAC_S3          0.11019    1.11257   0.099   0.9216  
## EAC_S4          1.17848    1.17371   1.004   0.3215  
## EAC_S5         -2.37229    1.30560  -1.817   0.0769 .
## EAC_S6          1.39478    1.44771   0.963   0.3413  
## OE_S1          -0.12693    0.96645  -0.131   0.8962  
## OE_S2           2.57507    1.16436   2.212   0.0329 *
## OE_S3          -0.05023    1.28621  -0.039   0.9690  
## BI_S1          -0.29949    0.76945  -0.389   0.6992  
## BI_S2          -1.94072    0.97350  -1.994   0.0532 .
## BI_S3           0.64978    1.22771   0.529   0.5996  
## BI_S4           0.51417    1.12300   0.458   0.6496  
## BI_S5          -0.15855    1.22330  -0.130   0.8975  
## autoconC       16.11843   23.62922   0.682   0.4992  
## nivel           0.35846    0.21984   1.631   0.1110  
## TM              8.86446    7.65900   1.157   0.2542  
## TLME           -7.27670    4.76500  -1.527   0.1348  
## autoconC:nivel -0.29836    0.29985  -0.995   0.3259  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 10.7 on 39 degrees of freedom
## Multiple R-squared:  0.3238, Adjusted R-squared:  -0.00561 
## F-statistic: 0.983 on 19 and 39 DF,  p-value: 0.4989
# Avaliação dos pressupostos.
par(mfrow = c(2, 2))
plot(fit)

layout(1)

#-----------------------------------------------------------------------