Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_multiple_response.wasp
Title produced by softwareMultiple Response
Date of computationWed, 12 Mar 2014 08:29:41 -0400
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Mar/12/t1394627585ctmnkcdkftivk99.htm/, Retrieved Tue, 14 May 2024 07:42:55 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=234188, Retrieved Tue, 14 May 2024 07:42:55 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact92
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Multiple Response] [] [2014-03-12 12:29:41] [47bce5c74f589f4867dbd57e9ca9f808] [Current]
Feedback Forum

Post a new message
Dataseries X:
NA NA 1 NA NA NA NA
 "'Man'"
 "'Man'"
 "'Man'"
1 1 1 1 1 1 NA
 "'Vrouw'"
 "'Man'"
 "'Vrouw'"
NA NA 1 NA NA NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Vrouw'"
1 NA NA NA NA NA NA
 "'Man'"
 "'Vrouw'"
 "'Vrouw'"
1 NA NA NA NA NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Vrouw'"
1 NA NA NA NA NA NA
 "'Man'"
 "'Vrouw'"
 "'Vrouw'"
NA NA 1 NA NA 1 1
 "'Vrouw'"
 "'Man'"
 "'Man'"
NA NA 1 NA NA 1 NA
 "'Vrouw'"
 "'Vrouw'"
 "'Man'"
1 NA NA NA NA NA NA
 "'Man'"
 "'Vrouw'"
 "'Man'"
1 NA NA NA NA NA NA
 "'Man'"
 "'Vrouw'"
 "'Vrouw'"
NA 1 NA NA NA NA NA
 "'Vrouw'"
 "'Man'"
 "'Vrouw'"
NA NA NA 1 NA NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Man'"
NA NA NA 1 NA NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Vrouw'"
1 1 1 1 1 1 NA
 "'Vrouw'"
 "'Man'"
 "'Vrouw'"
NA NA 1 NA 1 NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Vrouw'"
1 1 1 1 1 NA NA
 "'Man'"
 "'Man'"
 "'Vrouw'"
1 NA NA NA NA NA NA
 "'Vrouw'"
 "'Man'"
 "'Vrouw'"
1 NA 1 NA 1 NA NA
 "'Man'"
 "'Man'"
 "'Vrouw'"
NA NA NA NA NA NA NA
 "'Man'"
 "'Man'"
 "'Vrouw'"
1 1 1 1 1 1 NA
 "'Man'"
 "'Vrouw'"
 "'Man'"
1 NA NA NA NA NA NA
 "'Man'"
 "'Vrouw'"
 "'Man'"
1 1 1 1 1 NA NA
 "'Vrouw'"
 "'Vrouw'"
 "'Man'"




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net
R Engine error message
Error in array(list(NA, NA, 1, NA, NA, NA, NA, "'Man'", "'Man'", "'Man'",  : 
  length of 'dimnames' [1] not equal to array extent
Execution halted

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
R Engine error message & 
Error in array(list(NA, NA, 1, NA, NA, NA, NA, "'Man'", "'Man'", "'Man'",  : 
  length of 'dimnames' [1] not equal to array extent
Execution halted
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=234188&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[ROW][C]R Engine error message[/C][C]
Error in array(list(NA, NA, 1, NA, NA, NA, NA, "'Man'", "'Man'", "'Man'",  : 
  length of 'dimnames' [1] not equal to array extent
Execution halted
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=234188&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=234188&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net
R Engine error message
Error in array(list(NA, NA, 1, NA, NA, NA, NA, "'Man'", "'Man'", "'Man'",  : 
  length of 'dimnames' [1] not equal to array extent
Execution halted



Parameters (Session):
par1 = 0 ;
Parameters (R input):
par1 = 8 ;
R code (references can be found in the software module):
par1 <- as.numeric(par1)
y <- t(y)
nr <- length(y[,1])
nc <- length(y[1,])
ncm1 <- nc-1
if(par1==0) {
nc2 <- (nc*nc - nc) / 2
ncpnc2 <- nc + nc2
} else {
nc2 <- (ncm1*ncm1 - ncm1) / 2
ncpnc2 <- ncm1 + nc2
}
mr.freq <- as.data.frame(array(NA, dim=c(4,ncpnc2)))
if(par1>0) {
ctabout <- list()
z <- xx <- t(x[-par1,])
z[is.na(xx)] = 'NA'
for(i in 1:ncm1) z[!is.na(xx[,i]),i] = colnames(xx)[i]
single.response <- as.factor(as.character(x[par1,]))
jjj <- 0
for(i in 1:ncm1) {
jjj = jjj + 1
multiple.response <- as.factor(as.character(z[,i]))
ctabout[[jjj]] <- table(single.response, multiple.response)
jjj = jjj + 1
ctabout[[jjj]] <- chisq.test(single.response, multiple.response, simulate.p.value=T)
}
}
if(par1>0) x <- y[,-par1] else x <- y
x[is.na(x)] = 0
tab <- crossprod(as.matrix(x))
res2 <- round(crossprod(as.matrix(x)) / nrow(x), 4)
sum.responses <- length(as.vector(y)[!is.na(y)])
mr.freq[2,] <- c(as.vector(diag(tab)), tab[lower.tri(tab)])
mr.freq[1,] <- nr - mr.freq[2,]
mr.freq[3,] <- c(as.vector(diag(res2)), res2[lower.tri(res2)])
mr.freq[4,] <- c(as.vector(diag(tab)), rep(NA, nc2) ) / sum.responses #mr.freq[2,] / sum.responses
rownames(mr.freq) <- c('NA', 'Abs.Freq.', 'Rel.Freq.Cases', 'Rel.Freq.Responses')
if(par1 > 0) nc <- ncm1
myindex <- nc
for(i in 1:nc) {
colnames(mr.freq)[i] = colnames(x)[i]
ip1 <- i+1
if(ip1<=nc){
for(j in ip1:nc) {
myindex = myindex + 1
colnames(mr.freq)[myindex] = paste(colnames(x)[i], ':', colnames(x)[j], sep='')
}
}
}
t(mr.freq)
chisq.test(tab,simulate.p.value=T)
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Frequency Table of Multiple Response Items',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,paste('
',RC.texteval('t(mr.freq); chisq.test(tab,simulate.p.value=T)'),'
',sep=''))
a<-table.row.end(a)
if (par1 > 0) {
a<-table.row.start(a)
a<-table.element(a,paste('
',RC.texteval('ctabout'),'
',sep=''))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')