library("ggplot2")
library(dplyr)
##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(readxl)
library(pROC)
## Type 'citation("pROC")' for a citation.
##
## Attaching package: 'pROC'
## The following objects are masked from 'package:stats':
##
## cov, smooth, var
library(caret)
## Loading required package: lattice
knitr::opts_chunk$set(echo = TRUE)
Load Demographics, Products, and Transaction Data
# Read the Excel file
df1 <- read_excel("Data_Begin.xls")
df2 <- read_excel("Data_Middle.xls")
df3 <- read_excel("Data_End.xls")
df4 <- read_excel("Data_old.xls")
#combining both data set
df <- bind_rows(df1,df2,df3)
# View the data
head(df)
## # A tibble: 6 × 8
## Allias Grade Gender Citizen Arousal Valence Factor1 Factor2
## <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
## 1 Aarav A 0 0 -5.65 0.828 4.33 4.33
## 2 Adira A 1 1 -4.98 2.42 3.5 3.5
## 3 Akio A 0 1 0.614 -1.96 3.5 4.67
## 4 Alayna A 1 0 -4.22 0.0218 2.5 3.17
## 5 Anaya A 1 0 -3.61 -1.53 3.67 3.33
## 6 Aslan A 0 1 -10.5 0.388 3 3.83
str(df)
## tibble [486 × 8] (S3: tbl_df/tbl/data.frame)
## $ Allias : chr [1:486] "Aarav" "Adira" "Akio" "Alayna" ...
## $ Grade : chr [1:486] "A" "A" "A" "A" ...
## $ Gender : chr [1:486] "0" "1" "0" "1" ...
## $ Citizen: chr [1:486] "0" "1" "1" "0" ...
## $ Arousal: num [1:486] -5.649 -4.984 0.614 -4.22 -3.608 ...
## $ Valence: num [1:486] 0.8276 2.422 -1.9601 0.0218 -1.5332 ...
## $ Factor1: num [1:486] 4.33 3.5 3.5 2.5 3.67 ...
## $ Factor2: num [1:486] 4.33 3.5 4.67 3.17 3.33 ...
knitr::opts_chunk$set(echo = TRUE)
qqnorm(df1$Valence)
qqline(df1$Valence, col = "red")
qqnorm(df3$Valence)
qqline(df3$Valence, col = "red")
qqnorm(df1$Arousal)
qqline(df1$Arousal, col = "red")
qqnorm(df3$Arousal)
qqline(df3$Arousal, col = "red")
qqnorm(df1$Factor1)
qqline(df1$Factor1, col = "red")
qqnorm(df3$Factor1)
qqline(df3$Factor1, col = "red")
qqnorm(df1$Factor2)
qqline(df1$Factor2, col = "red")
qqnorm(df3$Factor2)
qqline(df3$Factor2, col = "red")
# Create the scatter plot
plot(scale(df1$Valence),scale(df1$Arousal), col = "blue", pch = 16, axes = FALSE, xlab = "Valence", ylab = "Arousal", main = "Valence and Arousal")
# Add second dataset
points(scale(df3$Valence),scale(df3$Arousal), col = "red", pch = 17)
# Optional: Add a legend to differentiate between the two datasets
legend("topright", legend = c("Early", "Later"), col = c("blue", "red"), pch = c(16, 17))
# Add custom axes centered at the middle of the graph
#axis(1, at = seq(min(df3$Valence), max(df3$Valence), by = 1)) # X-axis
#axis(2, at = seq(min(df3$Arousal), max(df3$Arousal), by = 1)) # Y-axis
# Add multiple textboxes
text(2.75, 1, "Happy", col = "black", cex = 1.2)
text(2.75, -2, "Relaxed ", col = "black", cex = 1.2)
text(-2.75, 1, "Angry", col = "black", cex = 1.2)
text(-2.75, -2, "Sad", col = "black", cex = 1.2)
# Add a box around the plot
box()
# Draw the x and y axes through the middle of the plot
abline(h = 0, v = 0, col = "black", lty = 2)
#visualize height
ggplot(df1, aes(x = scale(Factor1), fill = Gender)) +
geom_histogram(position = "dodge",axes = FALSE, binwidth = 50)
ggplot(df1, aes(x = scale(Factor2), fill = Gender)) +
geom_histogram(position = "dodge", binwidth = 50)
ggplot(df1, aes(x = scale(Factor1), fill = Grade)) +
geom_histogram(position = "dodge", binwidth = 50)
ggplot(df1, aes(x = scale(Factor1), fill = Grade)) +
geom_histogram(position = "dodge", binwidth = 050)
ggplot(df1, aes(x = scale(Valence), fill = Gender)) +
geom_histogram(position = "dodge", binwidth = 50)
ggplot(df1, aes(x = scale(Arousal), fill = Gender)) +
geom_histogram(position = "dodge", binwidth = 50)
ggplot(df1, aes(x = scale(Valence), fill = Grade)) +
geom_histogram(position = "dodge", binwidth = 50)
ggplot(df1, aes(x = scale(Arousal), fill = Grade)) +
geom_histogram(position = "dodge", binwidth = 50)
knitr::opts_chunk$set(echo = TRUE)
# Create the scatter plot
plot(scale(df1$Factor1),scale(df1$Factor2), col = "blue", pch = 16, axes = TRUE, xlab = "Factor 1: Disorienting Dilemma & Subsequent Reflection
", ylab = "Factor 2: Experimenting and Acting
", main = "Transformative Learning",
xlim = c(-3.04, 3.04), # Set x-axis limits from 0 to 6
ylim = c(-3.04, 3.04))# Set y-axis limits from 0 to 12)
# Add second dataset
points(scale(df3$Factor1),scale(df3$Factor2), col = "red", pch = 17)
# Optional: Add a legend to differentiate between the two datasets
legend("topright", legend = c("Early", "Later"), col = c("blue", "red"), pch = c(10, 0))
# Add a box around the plot
box()
text(2.4, .50, "Straigtforward", col = "black", cex = 1.2)
text(-2.7, -2.70, "Reflection ", col = "black", cex = 1.2)
text(-2.7, 0.5, "Profound ", col = "black", cex = 1.2)
text(2.15, -2.70, "No Transformation", col = "black", cex = 1.2)
# Draw the x and y axes through the middle of the plot
abline(h = 0, v = 0, col = "black", lty = 2)
knitr::opts_chunk$set(echo = TRUE)
# Group by gender and calculate the average score
summary_data <- df1 %>%
group_by(Gender) %>%
summarize(avg_score = mean(Factor1))
# Print the summary data
print(summary_data)
## # A tibble: 2 × 2
## Gender avg_score
## <chr> <dbl>
## 1 0 2.76
## 2 1 3.11
# Direct t-test between male and female
t_test_result <- t.test(Factor1 ~ Gender, data = df1)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Factor1 by Gender
## t = -1.8467, df = 40.324, p-value = 0.07214
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.73126692 0.03287983
## sample estimates:
## mean in group 0 mean in group 1
## 2.758333 3.107527
# Direct t-test between male and female
t_test_result <- t.test(Factor1 ~ Gender, data = df3)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Factor1 by Gender
## t = 0.19059, df = 147.08, p-value = 0.8491
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.2766919 0.3357578
## sample estimates:
## mean in group 0 mean in group 1
## 3.100962 3.071429
# Direct t-test between male and female
t_test_result <- t.test(Factor2 ~ Gender, data = df1)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Factor2 by Gender
## t = -0.88802, df = 40.141, p-value = 0.3798
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.5447722 0.2121557
## sample estimates:
## mean in group 0 mean in group 1
## 3.011111 3.177419
# Direct t-test between male and female
t_test_result <- t.test(Factor2 ~ Gender, data = df3)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Factor2 by Gender
## t = -0.41086, df = 153.41, p-value = 0.6817
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.3497216 0.2293003
## sample estimates:
## mean in group 0 mean in group 1
## 3.011218 3.071429
# Direct t-test between male and female
t_test_result <- t.test(Valence ~ Gender, data = df1)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Valence by Gender
## t = -2.0095, df = 46.195, p-value = 0.05035
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -1.62339061 0.00128913
## sample estimates:
## mean in group 0 mean in group 1
## -1.1473808 -0.3363301
# Direct t-test between male and female
t_test_result <- t.test(Valence ~ Gender, data = df3)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Valence by Gender
## t = -0.60162, df = 166.77, p-value = 0.5482
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.9103627 0.4851194
## sample estimates:
## mean in group 0 mean in group 1
## -1.255081 -1.042459
# Direct t-test between male and female
t_test_result <- t.test(Arousal ~ Gender, data = df1)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Arousal by Gender
## t = 0.61215, df = 40.268, p-value = 0.5439
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -1.057498 1.976697
## sample estimates:
## mean in group 0 mean in group 1
## -4.584351 -5.043950
# Direct t-test between male and female
t_test_result <- t.test(Arousal ~ Gender, data = df3)
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Arousal by Gender
## t = 0.30951, df = 145.36, p-value = 0.7574
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.7922783 1.0864933
## sample estimates:
## mean in group 0 mean in group 1
## -5.578866 -5.725974
# Print the result
print(t_test_result)
##
## Welch Two Sample t-test
##
## data: Arousal by Gender
## t = 0.30951, df = 145.36, p-value = 0.7574
## alternative hypothesis: true difference in means between group 0 and group 1 is not equal to 0
## 95 percent confidence interval:
## -0.7922783 1.0864933
## sample estimates:
## mean in group 0 mean in group 1
## -5.578866 -5.725974
knitr::opts_chunk$set(echo = TRUE)
df0<-df1
dff <- df0 %>%
mutate(Happy = ifelse(df0$Valence >=0 & df0$Arousal >=0, 1, ifelse(df0$Valence <0 & df0$Arousal >=0,2,ifelse(df0$Valence <0 & df0$Arousal <0,3,4))))%>%
mutate(Mezirow = ifelse(df0$Factor1 >=3 & df0$Factor2 >=3, 1, ifelse(df0$Factor1 <3 & df0$Factor2 >=3,2,ifelse(df0$Factor1 <3 & df0$Factor2 <0,3,4)))) %>%
mutate(HappyRelaxed = ifelse(df0$Valence >=0 , 1, 0))%>%
mutate(Mezirow1 = ifelse(df0$Factor1 >=3 , 1, 0))%>%
mutate(Mezirow2 = ifelse(df0$Factor2 >=3 , 1, 0))
x<-df0$Factor1
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 462717, p-value = 0.01723
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1935919
x<-df0$Factor2
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 629948, p-value = 0.232
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.09785377
x<-df0$Factor1
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 488197, p-value = 0.06751
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1491861
x<-df0$Factor2
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 537138, p-value = 0.4357
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.06389355
x1<-as.factor(dff$Happy)
x2<-as.factor(dff$Mezirow)
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 1 2 4
## 1 2 0 2
## 2 6 0 2
## 3 32 24 38
## 4 19 9 17
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test
##
## data: table_data
## X-squared = 7.3541, df = 6, p-value = 0.2893
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow1)
length(dff$HappyRelaxed)
## [1] 151
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 62 40
## 1 21 28
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 3.6037, df = 1, p-value = 0.05765
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow2)
length(dff$HappyRelaxed)
## [1] 151
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 40 62
## 1 19 30
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 5.198e-31, df = 1, p-value = 1
DD<-kruskal.test(dff$Factor1 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Happy
## Kruskal-Wallis chi-squared = 10.243, df = 3, p-value = 0.01661
DD<-kruskal.test(dff$Factor2 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Happy
## Kruskal-Wallis chi-squared = 2.0696, df = 3, p-value = 0.5581
DD<-kruskal.test(dff$Valence ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow1
## Kruskal-Wallis chi-squared = 7.5772, df = 1, p-value = 0.005911
DD<-kruskal.test(dff$Valence ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.76273, df = 1, p-value = 0.3825
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow1
## Kruskal-Wallis chi-squared = 8.0581, df = 1, p-value = 0.00453
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.22364, df = 1, p-value = 0.6363
DD<-kruskal.test(dff$Factor1 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 0.88414, df = 1, p-value = 0.3471
DD<-kruskal.test(dff$Factor2 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 9.9379e-05, df = 1, p-value = 0.992
knitr::opts_chunk$set(echo = TRUE)
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 3.9876, df = 4, p-value = 0.4077
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 12.282, df = 4, p-value = 0.01537
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 1.7413, df = 1, p-value = 0.187
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 5.0687, df = 1, p-value = 0.02436
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 2.6986, df = 4, p-value = 0.6095
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 0.95114, df = 4, p-value = 0.9171
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 4.5298, df = 1, p-value = 0.03331
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 0.3642, df = 1, p-value = 0.5462
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 3.9876, df = 4, p-value = 0.4077
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 12.282, df = 4, p-value = 0.01537
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 1.7413, df = 1, p-value = 0.187
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 5.0687, df = 1, p-value = 0.02436
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 2.6986, df = 4, p-value = 0.6095
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 0.95114, df = 4, p-value = 0.9171
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 4.5298, df = 1, p-value = 0.03331
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 0.3642, df = 1, p-value = 0.5462
knitr::opts_chunk$set(echo = TRUE)
df0<-df2
dff <- df0 %>%
mutate(Happy = ifelse(df0$Valence >=0 & df0$Arousal >=0, 1, ifelse(df0$Valence <0 & df0$Arousal >=0,2,ifelse(df0$Valence <0 & df0$Arousal <0,3,4))))%>%
mutate(Mezirow = ifelse(df0$Factor1 >=3 & df0$Factor2 >=3, 1, ifelse(df0$Factor1 <3 & df0$Factor2 >=3,2,ifelse(df0$Factor1 <3 & df0$Factor2 <0,3,4)))) %>%
mutate(HappyRelaxed = ifelse(df0$Valence >=0 , 1, 0))%>%
mutate(Mezirow1 = ifelse(df0$Factor1 >=3 , 1, 0))%>%
mutate(Mezirow2 = ifelse(df0$Factor2 >=3 , 1, 0))
x<-df0$Factor1
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 683221, p-value = 0.8238
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.01768329
x<-df0$Factor2
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 702846, p-value = 0.8945
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.0105337
x<-df0$Factor1
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 587999, p-value = 0.05023
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1545905
x<-df0$Factor2
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 621388, p-value = 0.1784
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1065846
x1<-as.factor(dff$Happy)
x2<-as.factor(dff$Mezirow)
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 1 2 4
## 1 2 0 0
## 3 59 20 43
## 4 17 4 16
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test
##
## data: table_data
## X-squared = 3.2782, df = 4, p-value = 0.5124
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow1)
length(dff$HappyRelaxed)
## [1] 161
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 54 68
## 1 15 24
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 0.20373, df = 1, p-value = 0.6517
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow2)
length(dff$HappyRelaxed)
## [1] 161
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 43 79
## 1 16 23
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 0.21271, df = 1, p-value = 0.6447
DD<-kruskal.test(dff$Factor1 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Happy
## Kruskal-Wallis chi-squared = 3.3473, df = 2, p-value = 0.1876
DD<-kruskal.test(dff$Factor2 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Happy
## Kruskal-Wallis chi-squared = 5.4216, df = 2, p-value = 0.06648
DD<-kruskal.test(dff$Valence ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow1
## Kruskal-Wallis chi-squared = 2.9406, df = 1, p-value = 0.08638
DD<-kruskal.test(dff$Valence ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.73883, df = 1, p-value = 0.39
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow1
## Kruskal-Wallis chi-squared = 0.61728, df = 1, p-value = 0.4321
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.014229, df = 1, p-value = 0.905
DD<-kruskal.test(dff$Factor1 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 1.0775, df = 1, p-value = 0.2993
DD<-kruskal.test(dff$Factor2 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 0.13262, df = 1, p-value = 0.7157
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 4.8339, df = 4, p-value = 0.3048
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 4.4651, df = 4, p-value = 0.3467
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 0.053323, df = 1, p-value = 0.8174
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 1.6689, df = 1, p-value = 0.1964
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 10.442, df = 4, p-value = 0.0336
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 3.8773, df = 4, p-value = 0.4229
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 0.44672, df = 1, p-value = 0.5039
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 1.8513, df = 1, p-value = 0.1736
knitr::opts_chunk$set(echo = TRUE)
df0<-df3
dff <- df0 %>%
mutate(Happy = ifelse(df0$Valence >=0 & df0$Arousal >=0, 1, ifelse(df0$Valence <0 & df0$Arousal >=0,2,ifelse(df0$Valence <0 & df0$Arousal <0,3,4))))%>%
mutate(Mezirow = ifelse(df0$Factor1 >=3 & df0$Factor2 >=3, 1, ifelse(df0$Factor1 <3 & df0$Factor2 >=3,2,ifelse(df0$Factor1 <3 & df0$Factor2 <0,3,4)))) %>%
mutate(HappyRelaxed = ifelse(df0$Valence >=0 , 1, 0))%>%
mutate(Mezirow1 = ifelse(df0$Factor1 >=3 , 1, 0))%>%
mutate(Mezirow2 = ifelse(df0$Factor2 >=3 , 1, 0))
x<-df0$Factor1
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 918483, p-value = 0.5455
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.04613818
x<-df0$Factor2
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
#model<-lm(df0$Grade~df0$Factor1+df0$Valence, data=df0)
#print(model)
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 991571, p-value = 0.08884
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.1293839
x<-df0$Factor1
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 964359, p-value = 0.1965
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.09838957
x<-df0$Factor2
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 1016023, p-value = 0.03826
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.1572342
x1<-as.factor(dff$Happy)
x2<-as.factor(dff$Mezirow)
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 1 2 4
## 1 0 0 1
## 2 2 0 1
## 3 63 16 36
## 4 23 4 28
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test
##
## data: table_data
## X-squared = 8.5997, df = 6, p-value = 0.1974
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow1)
length(dff$HappyRelaxed)
## [1] 174
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 45 73
## 1 30 26
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 3.0871, df = 1, p-value = 0.07892
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow2)
length(dff$HappyRelaxed)
## [1] 174
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 37 81
## 1 29 27
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 5.8928, df = 1, p-value = 0.0152
DD<-kruskal.test(dff$Factor1 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Happy
## Kruskal-Wallis chi-squared = 5.8121, df = 3, p-value = 0.1211
DD<-kruskal.test(dff$Factor2 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Happy
## Kruskal-Wallis chi-squared = 8.9242, df = 3, p-value = 0.03032
DD<-kruskal.test(dff$Valence ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow1
## Kruskal-Wallis chi-squared = 1.7839, df = 1, p-value = 0.1817
DD<-kruskal.test(dff$Valence ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow2
## Kruskal-Wallis chi-squared = 5.2395, df = 1, p-value = 0.02208
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow1
## Kruskal-Wallis chi-squared = 1.9245, df = 1, p-value = 0.1654
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow2
## Kruskal-Wallis chi-squared = 1.6092, df = 1, p-value = 0.2046
DD<-kruskal.test(dff$Factor1 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 3.4594, df = 1, p-value = 0.06289
DD<-kruskal.test(dff$Factor2 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 6.5699, df = 1, p-value = 0.01037
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 4.4127, df = 4, p-value = 0.353
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 5.1629, df = 4, p-value = 0.271
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 0.27177, df = 1, p-value = 0.6021
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 0.024095, df = 1, p-value = 0.8766
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 1.102, df = 4, p-value = 0.894
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 6.489, df = 4, p-value = 0.1655
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 0.55619, df = 1, p-value = 0.4558
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 0.28191, df = 1, p-value = 0.5955
knitr::opts_chunk$set(echo = TRUE)
df0<-df
dff <- df0 %>%
mutate(Happy = ifelse(df0$Valence >=0 & df0$Arousal >=0, 1, ifelse(df0$Valence <0 & df0$Arousal >=0,2,ifelse(df0$Valence <0 & df0$Arousal <0,3,4))))%>%
mutate(Mezirow = ifelse(df0$Factor1 >=3 & df0$Factor2 >=3, 1, ifelse(df0$Factor1 <3 & df0$Factor2 >=3,2,ifelse(df0$Factor1 <3 & df0$Factor2 <0,3,4)))) %>%
mutate(HappyRelaxed = ifelse(df0$Valence >=0 , 1, 0))%>%
mutate(Mezirow1 = ifelse(df0$Factor1 >=3 , 1, 0))%>%
mutate(Mezirow2 = ifelse(df0$Factor2 >=3 , 1, 0))
x<-df0$Factor1
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 18613287, p-value = 0.5511
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.02710192
x<-df0$Factor2
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 20800178, p-value = 0.05471
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.08720471
x<-df0$Factor1
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 18440449, p-value = 0.4267
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.03613599
x<-df0$Factor2
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 19280635, p-value = 0.8642
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.007779745
x1<-as.factor(dff$Happy)
x2<-as.factor(dff$Mezirow)
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 1 2 4
## 1 4 0 3
## 2 8 0 3
## 3 154 60 117
## 4 59 17 61
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test
##
## data: table_data
## X-squared = 9.643, df = 6, p-value = 0.1405
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow1)
length(dff$HappyRelaxed)
## [1] 486
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 161 181
## 1 66 78
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 0.022855, df = 1, p-value = 0.8798
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow2)
length(dff$HappyRelaxed)
## [1] 486
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 120 222
## 1 64 80
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 3.3837, df = 1, p-value = 0.06584
DD<-kruskal.test(dff$Factor1 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Happy
## Kruskal-Wallis chi-squared = 4.7253, df = 3, p-value = 0.1931
DD<-kruskal.test(dff$Factor2 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Happy
## Kruskal-Wallis chi-squared = 4.12, df = 3, p-value = 0.2488
DD<-kruskal.test(dff$Valence ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow1
## Kruskal-Wallis chi-squared = 1.2105, df = 1, p-value = 0.2712
DD<-kruskal.test(dff$Valence ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.30732, df = 1, p-value = 0.5793
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow1
## Kruskal-Wallis chi-squared = 0.0088726, df = 1, p-value = 0.925
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow2
## Kruskal-Wallis chi-squared = 1.1232, df = 1, p-value = 0.2892
DD<-kruskal.test(dff$Factor1 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 0.090273, df = 1, p-value = 0.7638
DD<-kruskal.test(dff$Factor2 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 3.4406, df = 1, p-value = 0.06361
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 7.2611, df = 4, p-value = 0.1227
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 13.909, df = 4, p-value = 0.007591
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 1.2925, df = 1, p-value = 0.2556
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 5.1523, df = 1, p-value = 0.02322
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 6.3591, df = 4, p-value = 0.1739
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 0.94936, df = 4, p-value = 0.9174
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 0.145, df = 1, p-value = 0.7034
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 3.3225, df = 1, p-value = 0.06834
knitr::opts_chunk$set(echo = TRUE)
df0<-df1
dff <- df0 %>%
mutate(Happy = ifelse(df0$Valence >=0 & df0$Arousal >=0, 1, ifelse(df0$Valence <0 & df0$Arousal >=0,2,ifelse(df0$Valence <0 & df0$Arousal <0,3,4))))%>%
mutate(Mezirow = ifelse(df0$Factor1 >=3 & df0$Factor2 >=3, 1, ifelse(df0$Factor1 <3 & df0$Factor2 >=3,2,ifelse(df0$Factor1 <3 & df0$Factor2 <0,3,4)))) %>%
mutate(HappyRelaxed = ifelse(df0$Valence >=0 , 1, 0))%>%
mutate(Mezirow1 = ifelse(df0$Factor1 >=3 , 1, 0))%>%
mutate(Mezirow2 = ifelse(df0$Factor2 >=3 , 1, 0))
x<-df0$Factor1
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 462717, p-value = 0.01723
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1935919
x<-df0$Factor2
y<-df0$Arousal
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 629948, p-value = 0.232
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## -0.09785377
x<-df0$Factor1
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 488197, p-value = 0.06751
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.1491861
x<-df0$Factor2
y<-df0$Valence
#chisq.test(table(x, y))
# Calculate the spearman correlation and test its significance
cor_test_result <- cor.test(x, y,method = "spearman")
# Print the results
print(cor_test_result)
##
## Spearman's rank correlation rho
##
## data: x and y
## S = 537138, p-value = 0.4357
## alternative hypothesis: true rho is not equal to 0
## sample estimates:
## rho
## 0.06389355
x1<-as.factor(dff$Happy)
x2<-as.factor(dff$Mezirow)
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 1 2 4
## 1 2 0 2
## 2 6 0 2
## 3 32 24 38
## 4 19 9 17
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test
##
## data: table_data
## X-squared = 7.3541, df = 6, p-value = 0.2893
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow1)
length(dff$HappyRelaxed)
## [1] 151
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 62 40
## 1 21 28
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 3.6037, df = 1, p-value = 0.05765
x1<-as.factor(dff$HappyRelaxed)
x2<-as.factor(dff$Mezirow2)
length(dff$HappyRelaxed)
## [1] 151
# Create a contingency table
table_data <- table(x1,x2)
# Print the contingency table
print(table_data)
## x2
## x1 0 1
## 0 40 62
## 1 19 30
# Perform the Chi-Square test
chi_square_result <- chisq.test(table_data)
# Print the test result
print(chi_square_result)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table_data
## X-squared = 5.198e-31, df = 1, p-value = 1
DD<-kruskal.test(dff$Factor1 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Happy
## Kruskal-Wallis chi-squared = 10.243, df = 3, p-value = 0.01661
DD<-kruskal.test(dff$Factor2 ~ dff$Happy)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Happy
## Kruskal-Wallis chi-squared = 2.0696, df = 3, p-value = 0.5581
DD<-kruskal.test(dff$Valence ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow1
## Kruskal-Wallis chi-squared = 7.5772, df = 1, p-value = 0.005911
DD<-kruskal.test(dff$Valence ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.76273, df = 1, p-value = 0.3825
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow1)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow1
## Kruskal-Wallis chi-squared = 8.0581, df = 1, p-value = 0.00453
DD<-kruskal.test(dff$Arousal ~ dff$Mezirow2)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Mezirow2
## Kruskal-Wallis chi-squared = 0.22364, df = 1, p-value = 0.6363
DD<-kruskal.test(dff$Factor1 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 0.88414, df = 1, p-value = 0.3471
DD<-kruskal.test(dff$Factor2 ~ dff$HappyRelaxed)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$HappyRelaxed
## Kruskal-Wallis chi-squared = 9.9379e-05, df = 1, p-value = 0.992
DD<-kruskal.test(dff$Factor2 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Grade
## Kruskal-Wallis chi-squared = 3.9876, df = 4, p-value = 0.4077
DD<-kruskal.test(dff$Factor1 ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Grade
## Kruskal-Wallis chi-squared = 12.282, df = 4, p-value = 0.01537
DD<-kruskal.test(dff$Factor2 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor2 by dff$Gender
## Kruskal-Wallis chi-squared = 1.7413, df = 1, p-value = 0.187
DD<-kruskal.test(dff$Factor1 ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Factor1 by dff$Gender
## Kruskal-Wallis chi-squared = 5.0687, df = 1, p-value = 0.02436
DD<-kruskal.test(dff$Valence ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Grade
## Kruskal-Wallis chi-squared = 2.6986, df = 4, p-value = 0.6095
DD<-kruskal.test(dff$Arousal ~ dff$Grade)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Grade
## Kruskal-Wallis chi-squared = 0.95114, df = 4, p-value = 0.9171
DD<-kruskal.test(dff$Valence ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Valence by dff$Gender
## Kruskal-Wallis chi-squared = 4.5298, df = 1, p-value = 0.03331
DD<-kruskal.test(dff$Arousal ~ dff$Gender)
print(DD)
##
## Kruskal-Wallis rank sum test
##
## data: dff$Arousal by dff$Gender
## Kruskal-Wallis chi-squared = 0.3642, df = 1, p-value = 0.5462
knitr::opts_chunk$set(echo = TRUE)