#Vize ödevi-Selin# #1. adım: Datayı çağırma library(readxl) data1=read_excel("C:\\Rvize\\data01570.xlsx", col_names = FALSE) dim(data1) #2.adım: Datadan çalışmak için örneklem seçmek #Not: Her defasında data ismini değiştiryoruz. Bu sayede hata yaptığımızda #direkt ana dataya geri gitmemize gerek kalmıyor. data2=cbind(data1[3:4], data1[10:11], data1[18], data1[20]) data2=rbind(data2[1:110,], data2[800:1000,]) #6 değişken ve 311 gözlenenden oluşan data seçimini tamamladık.dim ile kontrol dim(data2) is.matrix(data2) #n ve k tanımla k=ncol(data2) k n=nrow(data2) n data3=matrix(c(rep(0,n*k)),n,k) data3=as.matrix(data2) is.matrix(data3) summary(data3) out1<-matrix(c(rep(0,311*6)),311,6) colnames(out1)=c(colnames(data2)) rownames(out1)=c("p", "q", "p.q", "ss", "pbs", "c.pbs", "reli") #madde güçlüğü hesaplama p.stats=colMeans(data3) p.stats q.stats=1-p.stats q.stats out1[1,]=round(p.stats,3) out1[2,]=round(q.stats,3) var.i=p.stats*q.stats var.i ss.i=sqrt(var.i) ss.i out1[3,]=round(var.i,3) out1[4,]=round(ss.i,3) total=rowSums(data3) total sum(total) total.ort=mean(total) total.ort summary(total) data5=cbind(data3,total) library(polycor) for(i in 1:k){ out1[5,i] = round(polychor(data3[,i],rowSums(data3)),3) data4=data3[,-i] out1[6,i]=round(polychor(data3[,i],rowSums(data4)),3) p.cor=colMeans(data4) p.var=p.cor*(1-p.cor) reli.if.del=round((k/(k-1))*(1-(sum(p.var)/(var(rowSums(data4))))),3) out1[7,i]=reli.if.del } #standart hatayı hesaplamak var.tot=var(total) ss.tot=sqrt(var.tot) reli=round((k/(k-1))*(1-(sum(var.i)/(var.tot))),3) ste=ss.tot*sqrt(1-reli) ste a=min(rowSums(data3)) b=max(rowSums(data3)) hist(rowSums(data3)+0.001, ylim = c(0,150), breaks = b-a, main= "histogram of total scores", xlab= "total scores by groups", col = "green", border = "blue") z.scores.tot=(((data5[,7])-total.ort)/ss.tot) z.scores.tot plot(z.scores.tot, type="o", col="blue") t.scores.tot=(z.scores.tot*10)+50 t.scores.tot hist(t.scores.tot, type="o", col="blue") t.0=data5[data5[,7]== '0',] t.1=data5[data5[,7]== '1',] t.2=data5[data5[,7]== '2',] t.3=data5[data5[,7]== '3',] t.4=data5[data5[,7]== '4',] t.5=data5[data5[,7]== '5',] t.6=data5[data5[,7]== '6',] p.t.0=colMeans(t.0[,1:6]) p.t.1=colMeans(t.1[,1:6]) p.t.2=colMeans(t.2[,1:6]) p.t.3=colMeans(t.3[,1:6]) p.t.4=colMeans(t.4[,1:6]) p.t.5=colMeans(t.5[,1:6]) p.t.6=colMeans(t.6[,1:6]) p.tot=rbind(p.t.0, p.t.1, p.t.2, p.t.3, p.t.4, p.t.5, p.t.6) plot(p.tot[,1],main="itemdifficulty of i3", col="magenta", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) plot(p.tot[,2],main="itemdifficulty of i4", col="blue", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) plot(p.tot[,3],main="itemdifficulty of i10", col="green", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) plot(p.tot[,4],main="itemdifficulty of i11", col="purple", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) plot(p.tot[,5],main="itemdifficulty of i18", col="red", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) plot(p.tot[,6],main="itemdifficulty of i20", col="black", xlab="total scores by groups", ylab="item.difficulty", xlim= c(0,6), ylim= c(0,1)) item.discrimination<-out1[6,] item.difficulty<-out1[1,] plot(item.discrimination, type="p", pch=1, cex=4, col="blue", ylab = "item-total correlation/item difficulty", xlab ="item number", ylim = c(0,1), xlim = c(1,6), main = "test item discriminations" ) #hocam tüm aktardıklarınız için teşekkür ederiz :) bu yolda daha da gelişmek #dileğiyle