rm(list=ls())
library(dplyr)
##
## Caricamento pacchetto: 'dplyr'
## I seguenti oggetti sono mascherati da 'package:stats':
##
## filter, lag
## I seguenti oggetti sono mascherati da 'package:base':
##
## intersect, setdiff, setequal, union
library(psych)
library(cocor)
## Warning: il pacchetto 'cocor' è stato creato con R versione 4.4.3
library(magrittr)
setwd(dirname(rstudioapi::getActiveDocumentContext()$path))
pre_raw <- read.csv("PRE.csv")
post_raw <- read.csv("POST.csv")
pre_raw <- pre_raw[pre_raw$Ultima.pagina==max(pre_raw$Ultima.pagina,na.rm=T) & !is.na(pre_raw$Ultima.pagina),]
post_raw <- post_raw[post_raw$Ultima.pagina==max(post_raw$Ultima.pagina,na.rm=T) & !is.na(post_raw$Ultima.pagina),]
pre_code <- pre_raw$Codice.personale...Se.non.conosce.il.suo.codice.personale..chieda.istruzioni.al.somministratore...Il.suo.codice.è.formato.dalle.iniziali.del.nome.e.del.cognome.di.sua.madre..seguiti.da.giorno.e.mese.di.nascita...in.formato.numerico...di.sua.madre....Ad.esempio..se.sua.madre.fosse.Maria.Rossi..nata.il.cinque.gennaio..il.codice.sarebbe.MR0501...
post_code <- post_raw$Codice.personale...Se.non.conosce.il.suo.codice.personale..chieda.istruzioni.al.somministratore...Il.suo.codice.è.formato.dalle.iniziali.del.nome.e.del.cognome.di.sua.madre..seguiti.da.giorno.e.mese.di.nascita...in.formato.numerico...di.sua.madre....Ad.esempio..se.sua.madre.fosse.Maria.Rossi..nata.il.cinque.gennaio..il.codice.sarebbe.MR0501...
Removing spaces from strings
pre_code <- pre_code %>% gsub("\\s+","",.)
post_code <- post_code %>% gsub("\\s+","",.)
Sorting codes for easy pairing
pre_code <- pre_code %>% sort
post_code <- post_code %>% sort
Eliminating empty codes
pre_code <- pre_code[pre_code!=""]
post_code <- post_code[post_code!=""]
Coupling codes, allowing one character difference
coupples <- adist(pre_code,post_code) %>%
{which(.<2,arr.ind = T)}
Keeping only cases within a coupple
pre_code <- pre_code[coupples[,1]]
post_code <- post_code[coupples[,2]]
removing duplicates in one of the two columns, keeping last istances, rationale being that last answer is probably the intended one
non_duplicates <- (!(pre_code %>% duplicated(fromLast = T)) & !(post_code %>% duplicated(fromLast = T)))
pre_code <- pre_code[non_duplicates]
post_code <- post_code[non_duplicates]
Creating a dataframe with the good codes
couppled_codes <- cbind.data.frame(
pre_code,
post_code
)
keeping only relevant columns
pre_raw <- pre_raw[,9:132]
list of colnames
colnames(pre_raw) <- c(
'Code',
'Genere',
'Eta',
'Malattia',
'Psicoterapia',
'FSCRS_t_01_is',
'FSCRS_t_02_is',
'FSCRS_t_03_sc',
'FSCRS_t_04_is',
'FSCRS_t_05_sc',
'FSCRS_t_06_is',
'FSCRS_t_07_is',
'FSCRS_t_08_sc',
'FSCRS_t_09_hs',
'FSCRS_t_10_hs',
'FSCRS_t_11_sc',
'FSCRS_t_12_nn',
'FSCRS_t_13_sc',
'FSCRS_t_14_is',
'FSCRS_t_15_hs',
'FSCRS_t_16_sc',
'FSCRS_t_17_is',
'FSCRS_t_18_is',
'FSCRS_t_19_sc',
'FSCRS_t_20_is',
'FSCRS_t_21_sc',
'FSCRS_t_22_hs',
'FSCRS_s_01_is_PRE',
'FSCRS_s_02_is_PRE',
'FSCRS_s_03_sc_PRE',
'FSCRS_s_04_is_PRE',
'FSCRS_s_05_sc_PRE',
'FSCRS_s_06_is_PRE',
'FSCRS_s_07_is_PRE',
'FSCRS_s_08_sc_PRE',
'FSCRS_s_09_hs_PRE',
'FSCRS_s_10_hs_PRE',
'FSCRS_s_11_sc_PRE',
'FSCRS_s_12_sc_PRE',
'FSCRS_s_13_is_PRE',
'FSCRS_s_14_hs_PRE',
'FSCRS_s_15_sc_PRE',
'FSCRS_s_16_is_PRE',
'FSCRS_s_17_is_PRE',
'FSCRS_s_18_sc_PRE',
'FSCRS_s_19_is_PRE',
'FSCRS_s_20_sc_PRE',
'FSCRS_s_21_hs_PRE',
'FSCRS_s_22_nn_PRE',
'FSCRS_s_23_nn_PRE',
'FSCRS_s_24_nn_PRE',
'FSCRS_s_25_nn_PRE',
'FSCRS_s_26_nn_PRE',
'FSCRS_s_27_nn_PRE',
'FSCRS_s_28_nn_PRE',
'FSCRS_s_29_nn_PRE',
'FSCRS_s_30_nn_PRE',
'FSCRS_s_31_nn_PRE',
'FSCRS_s_32_nn_PRE',
'FSCRS_s_33_nn_PRE',
'FSCRS_s_34_nn_PRE',
'FSCRS_s_35_nn_PRE',
'FSCRS_s_36_nn_PRE',
'Shame_01',
'Shame_02',
'Shame_03',
'Shame_04',
'Shame_05',
'Shame_06',
'Shame_07',
'Shame_08',
'Shame_09',
'Shame_10',
'Shame_11',
'Shame_12',
'Shame_13',
'Shame_14',
'Shame_15',
'Shame_16',
'Shame_17',
'Shame_18',
'Shame_19',
'Shame_20',
'Shame_21',
'Shame_22',
'Shame_23',
'man_01',
'man_02',
'FSCRS_s_01_is_MIDDLE',
'FSCRS_s_02_is_MIDDLE',
'FSCRS_s_03_sc_MIDDLE',
'FSCRS_s_04_is_MIDDLE',
'FSCRS_s_05_sc_MIDDLE',
'FSCRS_s_06_is_MIDDLE',
'FSCRS_s_07_is_MIDDLE',
'FSCRS_s_08_sc_MIDDLE',
'FSCRS_s_09_hs_MIDDLE',
'FSCRS_s_10_hs_MIDDLE',
'FSCRS_s_11_sc_MIDDLE',
'FSCRS_s_12_sc_MIDDLE',
'FSCRS_s_13_is_MIDDLE',
'FSCRS_s_14_hs_MIDDLE',
'FSCRS_s_15_sc_MIDDLE',
'FSCRS_s_16_is_MIDDLE',
'FSCRS_s_17_is_MIDDLE',
'FSCRS_s_18_sc_MIDDLE',
'FSCRS_s_19_is_MIDDLE',
'FSCRS_s_20_sc_MIDDLE',
'FSCRS_s_21_hs_MIDDLE',
'FSCRS_s_22_nn_MIDDLE',
'FSCRS_s_23_nn_MIDDLE',
'FSCRS_s_24_nn_MIDDLE',
'FSCRS_s_25_nn_MIDDLE',
'FSCRS_s_26_nn_MIDDLE',
'FSCRS_s_27_nn_MIDDLE',
'FSCRS_s_28_nn_MIDDLE',
'FSCRS_s_29_nn_MIDDLE',
'FSCRS_s_30_nn_MIDDLE',
'FSCRS_s_31_nn_MIDDLE',
'FSCRS_s_32_nn_MIDDLE',
'FSCRS_s_33_nn_MIDDLE',
'FSCRS_s_34_nn_MIDDLE',
'FSCRS_s_35_nn_MIDDLE',
'FSCRS_s_36_nn_MIDDLE'
)
keeping only relevant columns
post_raw <- post_raw[,8:68]
list of relevant columns
colnames(post_raw) <- c(
'Code',
'FSCRS_t_01_is',
'FSCRS_t_02_is',
'FSCRS_t_03_sc',
'FSCRS_t_04_is',
'FSCRS_t_05_sc',
'FSCRS_t_06_is',
'FSCRS_t_07_is',
'FSCRS_t_08_sc',
'FSCRS_t_09_hs',
'FSCRS_t_10_hs',
'FSCRS_t_11_sc',
'FSCRS_t_12_nn',
'FSCRS_t_13_sc',
'FSCRS_t_14_is',
'FSCRS_t_15_hs',
'FSCRS_t_16_sc',
'FSCRS_t_17_is',
'FSCRS_t_18_is',
'FSCRS_t_19_sc',
'FSCRS_t_20_is',
'FSCRS_t_21_sc',
'FSCRS_t_22_hs',
'Genere',
'Eta',
'FSCRS_s_01_is',
'FSCRS_s_02_is',
'FSCRS_s_03_sc',
'FSCRS_s_04_is',
'FSCRS_s_05_sc',
'FSCRS_s_06_is',
'FSCRS_s_07_is',
'FSCRS_s_08_sc',
'FSCRS_s_09_hs',
'FSCRS_s_10_hs',
'FSCRS_s_11_sc',
'FSCRS_s_12_sc',
'FSCRS_s_13_is',
'FSCRS_s_14_hs',
'FSCRS_s_15_sc',
'FSCRS_s_16_is',
'FSCRS_s_17_is',
'FSCRS_s_18_sc',
'FSCRS_s_19_is',
'FSCRS_s_20_sc',
'FSCRS_s_21_hs',
'FSCRS_s_22_nn',
'FSCRS_s_23_nn',
'FSCRS_s_24_nn',
'FSCRS_s_25_nn',
'FSCRS_s_26_nn',
'FSCRS_s_27_nn',
'FSCRS_s_28_nn',
'FSCRS_s_29_nn',
'FSCRS_s_30_nn',
'FSCRS_s_31_nn',
'FSCRS_s_32_nn',
'FSCRS_s_33_nn',
'FSCRS_s_34_nn',
'FSCRS_s_35_nn',
'FSCRS_s_36_nn'
)
pre <- pre_raw %>% na.omit
post <- post_raw %>% na.omit
# sorting by code both dataset and code coupples
# pre <- pre[order(pre$Code),]
# post <- post[order(post$Code),]
#
# couppled_codes_pre <- couppled_codes$pre_code[order(couppled_codes$pre_code),]
recode_FSCRS <- function(x){
x <- gsub("^Per niente vera per me$",1,x)
x <- gsub("^Poco vera per me$",2,x)
x <- gsub("^Abbastanza vera per me$",3,x)
x <- gsub("^Alquanto vera per me$",4,x)
x <- gsub("^Alquanto vera per me$",4,x)
x <- gsub("^Totalmente vera per me$",5,x)
return(as.numeric(x))
}
recode_shame <- function(x){
x <- gsub("^Per nulla$",1,x)
x <- gsub("^Un poco$",2,x)
x <- gsub("^Abbastanza$",3,x)
x <- gsub("^Molto$",4,x)
return(as.numeric(x))
}
pre <- pre %>% mutate(
across(
matches("^FSCRS_"),
recode_FSCRS
)
) %>%
mutate(
across(
matches("^Shame_"),
recode_shame
)
)
post <- post %>% mutate(
across(
matches("^FSCRS_"),
recode_FSCRS
)
)
removing spaces from codes
pre$Code <- pre$Code %>% gsub("\\s+","",.)
post$Code <- post$Code %>% gsub("\\s+","",.)
Trait
pre$FSCRS_t_is_pre <- pre %>%
select(matches("^FSCRS_t_.*_is$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_t_is_post <- post %>%
select(matches("^FSCRS_t_.*_is$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_t_sc_pre <- pre %>%
select(matches("^FSCRS_t_.*_sc$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_t_sc_post <- post %>%
select(matches("^FSCRS_t_.*_sc$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_t_hs_pre <- pre %>%
select(matches("^FSCRS_t_.*_hs$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_t_hs_post <- post %>%
select(matches("^FSCRS_t_.*_hs$")) %>%
apply(1,mean,na.rm=T)
State
pre$FSCRS_s_hs_pre <- pre %>%
select(matches("^FSCRS_s_.*_hs_PRE$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_s_hs_middle <- pre %>%
select(matches("^FSCRS_s_.*_hs_MIDDLE$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_s_hs_post <- post %>%
select(matches("^FSCRS_s_.*_hs$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_s_is_pre <- pre %>%
select(matches("^FSCRS_s_.*_is_PRE$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_s_is_middle <- pre %>%
select(matches("^FSCRS_s_.*_is_MIDDLE$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_s_is_post <- post %>%
select(matches("^FSCRS_s_.*_is$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_s_sc_pre <- pre %>%
select(matches("^FSCRS_s_.*_sc_PRE$")) %>%
apply(1,mean,na.rm=T)
pre$FSCRS_s_sc_middle <- pre %>%
select(matches("^FSCRS_s_.*_sc_MIDDLE$")) %>%
apply(1,mean,na.rm=T)
post$FSCRS_s_sc_post <- post %>%
select(matches("^FSCRS_s_.*_sc$")) %>%
apply(1,mean,na.rm=T)
Correlazione di TRATTO di INADEGUATEZZA DEL SÉ
cor_t_is <- cor(
pre$FSCRS_t_is_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_is_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.7619411
Correlazione di TRATTO di ODIO DEL SÉ
cor_t_hs <- cor(
pre$FSCRS_t_hs_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_hs_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.7519893
Correlazione di TRATTO di GENTILEZZA VERSO SÉ
cor_t_sc <- cor(
pre$FSCRS_t_sc_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_sc_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.734741
Correlazione MEDIA di TRATTO
mean_cor_t <- mean(cor_t_hs,cor_t_is,cor_t_sc) %T>% print
## [1] 0.7519893
Correlazione su STATO di INADEGUATEZZA DEL SÉ
cor_s_is <- cor(
pre$FSCRS_s_is_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_is_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.4815118
Correlazione su STATO di ODIO DEL SÉ
cor_s_hs <- cor(
pre$FSCRS_s_hs_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_hs_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.5412769
Correlazione su STATO di GENTILEZZA VERSO IL SÉ
cor_s_sc <- cor(
pre$FSCRS_s_sc_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_sc_post[match(couppled_codes$post_code,post$Code)],
use="pair"
) %T>% print
## [1] 0.7144727
mean_cor_s <- mean(c(cor_s_hs,cor_s_sc,cor_s_is)) %T>% print
## [1] 0.5790871
Correlazioni pre-middle
cor(
pre$FSCRS_s_is_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_is_middle[match(couppled_codes$pre_code,pre$Code)],
use="pair"
)
## [1] 0.8989281
cor(
pre$FSCRS_s_hs_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_hs_middle[match(couppled_codes$pre_code,pre$Code)],
use="pair"
)
## [1] 0.6532716
cor(
pre$FSCRS_s_sc_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_sc_middle[match(couppled_codes$pre_code,pre$Code)],
use="pair"
)
## [1] 0.8773338
Creazione di unico dataset per comodità
corframe <- data.frame(pre$FSCRS_s_is_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_is_middle[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_is_post[match(couppled_codes$post_code,post$Code)],
pre$FSCRS_s_hs_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_hs_middle[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_hs_post[match(couppled_codes$post_code,post$Code)],
pre$FSCRS_s_sc_pre[match(couppled_codes$pre_code,pre$Code)],
pre$FSCRS_s_sc_middle[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_s_sc_post[match(couppled_codes$post_code,post$Code)],
pre$FSCRS_t_is_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_is_post[match(couppled_codes$post_code,post$Code)],
pre$FSCRS_t_hs_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_hs_post[match(couppled_codes$post_code,post$Code)],
pre$FSCRS_t_sc_pre[match(couppled_codes$pre_code,pre$Code)],
post$FSCRS_t_sc_post[match(couppled_codes$post_code,post$Code)])
Nomi delle colonne
colnames(corframe) <- c("Stato_is_pre", "Stato_is_middle", "Stato_is_post",
"Stato_hs_pre", "Stato_hs_middle", "Stato_hs_post",
"Stato_sc_pre", "Stato_sc_middle", "Stato_sc_post",
"Tratto_is_pre", "Tratto_is_post",
"Tratto_hs_pre", "Tratto_hs_post",
"Tratto_sc_pre", "Tratto_sc_post")
Indagine inferenziale su differenze tra correlazioni
Solo quella sull’inadeguatezza del Sè ha un p-value significativo
cocor(~ Stato_is_pre + Stato_is_post | Tratto_is_pre + Tratto_is_post, data=corframe)
##
## Results of a comparison of two nonoverlapping correlations based on dependent groups
##
## Comparison between r.jk (Stato_is_pre, Stato_is_post) = 0.4815 and r.hm (Tratto_is_pre, Tratto_is_post) = 0.7619
## Difference: r.jk - r.hm = -0.2804
## Related correlations: r.jh = 0.8425, r.jm = 0.6242, r.kh = 0.5662, r.km = 0.7998
## Data: corframe: j = Stato_is_pre, k = Stato_is_post, h = Tratto_is_pre, m = Tratto_is_post
## Group size: n = 44
## Null hypothesis: r.jk is equal to r.hm
## Alternative hypothesis: r.jk is not equal to r.hm (two-sided)
## Alpha: 0.05
##
## pearson1898: Pearson and Filon's z (1898)
## z = -2.9938, p-value = 0.0028
## Null hypothesis rejected
##
## dunn1969: Dunn and Clark's z (1969)
## z = -3.3632, p-value = 0.0008
## Null hypothesis rejected
##
## steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
## z = -3.2396, p-value = 0.0012
## Null hypothesis rejected
##
## raghunathan1996: Raghunathan, Rosenthal, and Rubin's (1996) modification of Pearson and Filon's z (1898)
## z = -3.3632, p-value = 0.0008
## Null hypothesis rejected
##
## silver2004: Silver, Hittner, and May's (2004) modification of Dunn and Clark's z (1969) using a backtransformed average Fisher's (1921) Z procedure
## z = -3.2838, p-value = 0.0010
## Null hypothesis rejected
##
## zou2007: Zou's (2007) confidence interval
## 95% confidence interval for r.jk - r.hm: -0.5024 -0.1136
## Null hypothesis rejected (Interval does not include 0)
cocor(~ Stato_hs_pre + Stato_hs_post | Tratto_hs_pre + Tratto_hs_post, data=corframe)
##
## Results of a comparison of two nonoverlapping correlations based on dependent groups
##
## Comparison between r.jk (Stato_hs_pre, Stato_hs_post) = 0.5413 and r.hm (Tratto_hs_pre, Tratto_hs_post) = 0.752
## Difference: r.jk - r.hm = -0.2107
## Related correlations: r.jh = 0.6188, r.jm = 0.5375, r.kh = 0.5222, r.km = 0.5522
## Data: corframe: j = Stato_hs_pre, k = Stato_hs_post, h = Tratto_hs_pre, m = Tratto_hs_post
## Group size: n = 44
## Null hypothesis: r.jk is equal to r.hm
## Alternative hypothesis: r.jk is not equal to r.hm (two-sided)
## Alpha: 0.05
##
## pearson1898: Pearson and Filon's z (1898)
## z = -1.9021, p-value = 0.0572
## Null hypothesis retained
##
## dunn1969: Dunn and Clark's z (1969)
## z = -1.9324, p-value = 0.0533
## Null hypothesis retained
##
## steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
## z = -1.9295, p-value = 0.0537
## Null hypothesis retained
##
## raghunathan1996: Raghunathan, Rosenthal, and Rubin's (1996) modification of Pearson and Filon's z (1898)
## z = -1.9324, p-value = 0.0533
## Null hypothesis retained
##
## silver2004: Silver, Hittner, and May's (2004) modification of Dunn and Clark's z (1969) using a backtransformed average Fisher's (1921) Z procedure
## z = -1.9262, p-value = 0.0541
## Null hypothesis retained
##
## zou2007: Zou's (2007) confidence interval
## 95% confidence interval for r.jk - r.hm: -0.4575 0.0032
## Null hypothesis retained (Interval includes 0)
cocor(~ Stato_sc_pre + Stato_sc_post | Tratto_sc_pre + Tratto_sc_post, data=corframe)
##
## Results of a comparison of two nonoverlapping correlations based on dependent groups
##
## Comparison between r.jk (Stato_sc_pre, Stato_sc_post) = 0.7145 and r.hm (Tratto_sc_pre, Tratto_sc_post) = 0.7347
## Difference: r.jk - r.hm = -0.0203
## Related correlations: r.jh = 0.9121, r.jm = 0.6327, r.kh = 0.7603, r.km = 0.8988
## Data: corframe: j = Stato_sc_pre, k = Stato_sc_post, h = Tratto_sc_pre, m = Tratto_sc_post
## Group size: n = 44
## Null hypothesis: r.jk is equal to r.hm
## Alternative hypothesis: r.jk is not equal to r.hm (two-sided)
## Alpha: 0.05
##
## pearson1898: Pearson and Filon's z (1898)
## z = -0.3714, p-value = 0.7103
## Null hypothesis retained
##
## dunn1969: Dunn and Clark's z (1969)
## z = -0.3596, p-value = 0.7191
## Null hypothesis retained
##
## steiger1980: Steiger's (1980) modification of Dunn and Clark's z (1969) using average correlations
## z = -0.3594, p-value = 0.7193
## Null hypothesis retained
##
## raghunathan1996: Raghunathan, Rosenthal, and Rubin's (1996) modification of Pearson and Filon's z (1898)
## z = -0.3596, p-value = 0.7191
## Null hypothesis retained
##
## silver2004: Silver, Hittner, and May's (2004) modification of Dunn and Clark's z (1969) using a backtransformed average Fisher's (1921) Z procedure
## z = -0.3596, p-value = 0.7192
## Null hypothesis retained
##
## zou2007: Zou's (2007) confidence interval
## 95% confidence interval for r.jk - r.hm: -0.1514 0.1027
## Null hypothesis retained (Interval includes 0)
Is there a significant difference betweeen scores? Through t-test State
t.test(corframe$Stato_is_pre, corframe$Stato_is_post, paired=T)
##
## Paired t-test
##
## data: corframe$Stato_is_pre and corframe$Stato_is_post
## t = 1.4761, df = 43, p-value = 0.1472
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.06011173 0.38839456
## sample estimates:
## mean difference
## 0.1641414
t.test(corframe$Stato_hs_pre, corframe$Stato_hs_post, paired=T)
##
## Paired t-test
##
## data: corframe$Stato_hs_pre and corframe$Stato_hs_post
## t = 1.1773, df = 43, p-value = 0.2456
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.0526632 0.2003905
## sample estimates:
## mean difference
## 0.07386364
t.test(corframe$Stato_sc_pre, corframe$Stato_sc_post, paired=T)
##
## Paired t-test
##
## data: corframe$Stato_sc_pre and corframe$Stato_sc_post
## t = -0.99837, df = 43, p-value = 0.3237
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.21448801 0.07244256
## sample estimates:
## mean difference
## -0.07102273
Trait
t.test(corframe$Tratto_is_pre, corframe$Tratto_is_post, paired=T)
##
## Paired t-test
##
## data: corframe$Tratto_is_pre and corframe$Tratto_is_post
## t = 3.2197, df = 43, p-value = 0.002444
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 0.09435326 0.41069724
## sample estimates:
## mean difference
## 0.2525253
t.test(corframe$Tratto_hs_pre, corframe$Tratto_hs_post, paired=T)
##
## Paired t-test
##
## data: corframe$Tratto_hs_pre and corframe$Tratto_hs_post
## t = 2.5811, df = 43, p-value = 0.01334
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## 0.02733291 0.22266709
## sample estimates:
## mean difference
## 0.125
t.test(corframe$Tratto_sc_pre, corframe$Tratto_sc_post, paired=T)
##
## Paired t-test
##
## data: corframe$Tratto_sc_pre and corframe$Tratto_sc_post
## t = -1.6392, df = 43, p-value = 0.1085
## alternative hypothesis: true mean difference is not equal to 0
## 95 percent confidence interval:
## -0.24076856 0.02485947
## sample estimates:
## mean difference
## -0.1079545
Mean Standard deviation of state subscales
mean_st_s <- mean(c(
sd(corframe$Stato_is_pre - corframe$Stato_is_post),
sd(corframe$Stato_hs_pre - corframe$Stato_hs_post),
sd(corframe$Stato_sc_pre - corframe$Stato_sc_post)
))
Mean Standard deviation of trait subscales
mean_st_t <- mean(c(
sd(corframe$Tratto_is_pre - corframe$Tratto_is_post),
sd(corframe$Tratto_hs_pre - corframe$Tratto_hs_post),
sd(corframe$Tratto_sc_pre - corframe$Tratto_sc_post)
))
Le correlazioni medie sono più basse per la versione di stato del questionario e la variabilità osservata è più elevata per la versione di stato del questionario.
Infatti, la media delle correlazioni di stato è 0.58, mentre la media delle correlazioni di tratto è 0.75. Invece, la deviazione standard del questionario di stato è 0.54 mentre la deviazione stadard del questionario di tratto è 0.43.