WRS install.packages(‘WRS’, repos=“http://R-Forge.R-project.org”) ile indiirldi.
library("WRS")
df1 ve df2 olarak cinsiyeti 1 ve 2 olanlar için veriler hazırlandı.
df1<-df[df$sex==1,]
df2<-df[df$sex==2,]
df1$case_no<-NULL
df1$Okul_groupped<-NULL
colnames(df1)
[1] "sex" "MGO" "PApGO" "PAvGO" "EFFI" "HANDI" "CHEAT" "CMGS" "CPApGS" "CPAvGS"
colnames(df1)<-c( "sex","MGO1","PApGO1","PAvGO1","EFFI1","HANDI1","CHEAT1","CMGS1","CPApGS1","CPAvGS1")
df2$case_no<-NULL
df2$Okul_groupped<-NULL
colnames(df2)
[1] "sex" "MGO" "PApGO" "PAvGO" "EFFI" "HANDI" "CHEAT" "CMGS" "CPApGS" "CPAvGS"
colnames(df2)<-c( "sex","MGO2","PApGO2","PAvGO2","EFFI2","HANDI2","CHEAT2","CMGS2","CPApGS2","CPAvGS2")
df1$sex<-NULL
df2$sex<-NULL
head(df1)
head(df2)
Listeye çevrilip tek bir liste olarak ayarlandı. İlk önce cinsiyeti 1 olanlar daha sonra cinsiyeti 2 olanlar listeye eklendi. ([Rand_Wilcox]_Introduction_to_Robust_Estimation_an(z-lib.org).pdf kitabının 8.7.2 bölümünde liste olarak da mulrank fonksiyonun çalıştırılabileceği yazıyor.)
listdf1<-as.list(df1)
listdf2<-as.list(df2)
df_bind_list<-c(listdf1,listdf2)
Her iki grup için (Kız ve Erkek) 9 tane ölçülmüş değişken var. Bu
değişkenler şunlar:
c(“MGO”,
“PApGO”,“PAvGO1”,“EFFI”,“HANDI”,“CHEAT”,“CMGS”,“CPApGS”,“CPAvGS”)
CİNSİYETE GÖRE MANOVA :not significant.
A MANOVA was conducted on the ranked data using Munzel and Brunner’s (2000) method, implemented in R using the mulrank() function (Wilcox, 2005). There was no significant main effect of sex on …, F = 1.64, p = .28.
mulrank(2, 9, df_bind_list)
$test.stat
[1] 1.282841
$nu1
[1] 3.077832
$p.value
[,1]
[1,] 0.2780856
$N
[1] 199
$q.hat
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 0.5439581 0.5235993 0.5340487 0.5589161 0.4970413 0.4819659 0.5385808 0.5131029
[2,] 0.4830930 0.4965482 0.5014794 0.4725027 0.4880242 0.5024186 0.4864275 0.5069741
[,9]
[1,] 0.5317710
[2,] 0.4875781
WRS2 indiirldi ve denendi fakat “mulrank” fonksiyonu mevcut değil.
library("WRS2")
mulrank(2, 9, df_bind_list)
Error in mulrank(2, 9, df_bind_list) : "mulrank" fonksiyonu bulunamadı
OKULA GÖRE MANOVA : significant
A MANOVA was conducted on the ranked data using Munzel and Brunner’s (2000) method, implemented in R using the mulrank() function (Wilcox, 2005). There was a significant main effect of the type of school on …. , F = 19.38, p < .05.
okul1<-df[df$Okul_groupped==1,]
okul2<-df[df$Okul_groupped==2,]
okul1$case_no<-NULL
okul1$sex<-NULL
okul1$Okul_groupped<-NULL
colnames(okul1)
[1] "MGO" "PApGO" "PAvGO" "EFFI" "HANDI" "CHEAT" "CMGS" "CPApGS" "CPAvGS"
colnames(okul1)<-c( "MGO1","PApGO1","PAvGO1","EFFI1","HANDI1","CHEAT1","CMGS1","CPApGS1","CPAvGS1")
okul2$case_no<-NULL
okul2$sex<-NULL
okul2$Okul_groupped<-NULL
colnames(okul2)<-c( "MGO2","PApGO2","PAvGO2","EFFI2","HANDI2","CHEAT2","CMGS2","CPApGS2","CPAvGS2")
okullist1<-as.list(okul1)
okullist2<-as.list(okul2)
okullist_bind<-c(okullist1,okullist2)
mulrank2(2, 9, okullist_bind)
$test.stat
[1] 19.37822
$nu1
[1] 3.539232
$p.value
[,1]
[1,] 2.153833e-14
$N
[1] 199
$q.hat
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8]
[1,] 0.3681627 0.4382545 0.4215618 0.3647548 0.5691388 0.6111592 0.3894761 0.3789060
[2,] 0.5935135 0.5608502 0.5702362 0.6111304 0.4430775 0.4093745 0.5656443 0.5855138
[,9]
[1,] 0.4189626
[2,] 0.5611101
FOLLUW-UP MANOVA
t.test(CHEAT ~ Okul_groupped, data = df , var.equal = TRUE)
Two Sample t-test
data: CHEAT by Okul_groupped
t = 5.4117, df = 197, p-value = 1.802e-07
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
2.185612 4.691851
sample estimates:
mean in group 1 mean in group 2
11.965517 8.526786
t.test(EFFI ~ Okul_groupped, data = df, var.equal = TRUE)
Two Sample t-test
data: EFFI by Okul_groupped
t = -6.7224, df = 197, p-value = 1.884e-10
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-7.055602 -3.854907
sample estimates:
mean in group 1 mean in group 2
11.08046 16.53571
t.test(PApGO ~ Okul_groupped, data = df, var.equal = TRUE)
Two Sample t-test
data: PApGO by Okul_groupped
t = -2.728, df = 197, p-value = 0.006948
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-3.3344100 -0.5362797
sample estimates:
mean in group 1 mean in group 2
12.68966 14.62500
t.test(HANDI ~ Okul_groupped, data = df , var.equal = TRUE)
Two Sample t-test
data: HANDI by Okul_groupped
t = 3.1303, df = 197, p-value = 0.002012
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
1.200744 5.289815
sample estimates:
mean in group 1 mean in group 2
20.29885 17.05357
t.test(CMGS ~ Okul_groupped, data = df, var.equal = TRUE)
Two Sample t-test
data: CMGS by Okul_groupped
t = -4.8835, df = 197, p-value = 2.151e-06
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-6.146784 -2.610400
sample estimates:
mean in group 1 mean in group 2
14.18391 18.56250
t.test(CPApGS ~ Okul_groupped, data = df, var.equal = TRUE)
Two Sample t-test
data: CPApGS by Okul_groupped
t = -5.8014, df = 197, p-value = 2.588e-08
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-3.698831 -1.822105
sample estimates:
mean in group 1 mean in group 2
6.793103 9.553571
t.test(CPAvGS ~ Okul_groupped, data = df, var.equal = TRUE)
Two Sample t-test
data: CPAvGS by Okul_groupped
t = -3.7029, df = 197, p-value = 0.0002766
alternative hypothesis: true difference in means between group 1 and group 2 is not equal to 0
95 percent confidence interval:
-3.990596 -1.217121
sample estimates:
mean in group 1 mean in group 2
12.57471 15.17857
LDA ANALİZİ
The coefficients tell us the relative contribution of each variable to the variates. Cheat, HAMDI, CMGS and CPAVGS have opposite effect on the variant LD1 where as EFFI, PAPGO and CPAPGS have positive relationship.
library("MASS")
lda_sonuc<-lda(Okul_groupped ~ CHEAT+EFFI+PApGO+HANDI+CMGS+CPApGS+CPAvGS, data = df, prior = c(87, 112)/199)
lda_sonuc
Call:
lda(Okul_groupped ~ CHEAT + EFFI + PApGO + HANDI + CMGS + CPApGS +
CPAvGS, data = df, prior = c(87, 112)/199)
Prior probabilities of groups:
1 2
0.4371859 0.5628141
Group means:
CHEAT EFFI PApGO HANDI CMGS CPApGS CPAvGS
1 11.965517 11.08046 12.68966 20.29885 14.18391 6.793103 12.57471
2 8.526786 16.53571 14.62500 17.05357 18.56250 9.553571 15.17857
Coefficients of linear discriminants:
LD1
CHEAT -0.01929444
EFFI 0.11284641
PApGO 0.01571188
HANDI -0.03740453
CMGS -0.03569273
CPApGS 0.17435903
CPAvGS -0.01085168