Hi everybody!
I would like to export the results of a test statistic in a *.csv file,
but get an error.
The code is below.
The data are attached as .txt with tab as separator. I tried to get a
sample dataset, but for some reason it didn't work, so please excuse the
length of the file. I also attached a txt with the output (copy/paste)
in case that helps.
----
> library(WRS)
> ssfamed <- read.table(file=file.choose(), header=T, sep="\t")
> ssfa_Asfc <- fac2list(ssfa[,7], ssfa[3]) #store into list mode
> test <- pbmcp(ssfa_Asfc, alpha=0.05, nboot=2000, bhop=F) #it takes
about 5 seconds to run
> write.csv(test, file="pbmcp.csv", append=F, quote=F, row.names=F)
Error in data.frame(output = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, :
arguments imply differing number of rows: 15, 6, 1
----
I guess it is because of the formatting of the "test" object and I
should reorganize it, but I actually have no idea how to do it.
Tips would be greatly appreciated!
Thanks in advance
Ivan
> test
$output
con.num psihat p.value p.crit ci.lower ci.upper
[1,] 1 20.3256966 0.088 0.007142857 -10.629848 56.45937
[2,] 2 10.6291913 0.424 0.012780000 -26.244406 54.74194
[3,] 3 21.0332978 0.270 0.009090909 -26.948600 75.02653
[4,] 4 37.4139631 0.024 0.006666667 -7.917938 82.26128
[5,] 5 4.5993840 0.792 0.050000000 -41.385326 54.43119
[6,] 6 -9.6965053 0.524 0.020400000 -45.524102 29.26694
[7,] 7 0.7076012 0.995 0.050000000 -48.416521 50.75144
[8,] 8 17.0882665 0.274 0.010220000 -29.177314 57.76231
[9,] 9 -15.7263126 0.345 0.011360000 -62.085332 29.02764
[10,] 10 10.4041065 0.620 0.025400000 -43.476849 60.74339
[11,] 11 26.7847718 0.157 0.008333333 -22.430393 71.40265
[12,] 12 -6.0298073 0.702 0.033800000 -56.834770 43.63653
[13,] 13 16.3806653 0.449 0.017020000 -41.741429 70.32682
[14,] 14 -16.4339138 0.438 0.014600000 -76.696548 41.58294
[15,] 15 -32.8145791 0.100 0.007692308 -85.686738 20.56512
$con
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1 1 1 1 1 0 0 0 0 0 0 0 0 0
[2,] -1 0 0 0 0 1 1 1 1 0 0 0 0 0
[3,] 0 -1 0 0 0 -1 0 0 0 1 1 1 0 0
[4,] 0 0 -1 0 0 0 -1 0 0 -1 0 0 1 1
[5,] 0 0 0 -1 0 0 0 -1 0 0 -1 0 -1 0
[6,] 0 0 0 0 -1 0 0 0 -1 0 0 -1 0 -1
[,15]
[1,] 0
[2,] 0
[3,] 0
[4,] 0
[5,] 1
[6,] -1
$num.sig
[1] 0
SPECSHOR BONE TO_POS Asfc.median Smc.median
cotau tm M1 143.20655 6.411332
cotau tm M1 180.0317145 31.347971
cotau tm M1 121.639695 5.6496555
cotau tm M1 175.032101 8.954671
cotau tm M1 196.754496 8.279096
cotau tm M1 208.387571 10.385299
cotau tm M2 83.7698535 9.358691
cotau tm M2 190.261243 18.6577715
cotau tm M2 35.94771 3.033461
cotau tm M2 158.676376 11.1933385
cotau tm M2 228.321783 10.385299
cotau tm M2 247.0614745 11.233078
cotau tm M2 53.9788715 2.4174965
cotau tm M2 218.604999 10.0210185
cotau tm M2 210.735137 10.1004975
cotau tm M2 167.3723045 19.7969755
cotau tm M2 311.495118 19.459188
cotau tm M3 316.3791595 27.691922
cotau tm M3 238.75643 13.8956355
cotau tm M3 277.445134 26.824272
cotau tm M3 142.000378 17.9093415
cotau tm M3 242.585585 19.128024
cotau tm M3 285.6413885 21.7309725
cotau tm M3 61.010164 6.2060105
cotau tm M3 353.163364 24.2147015
cotau tm M3 150.750955 11.5311255
cotau tm M3 300.159889 13.617458
cotau tm M3 298.999937 19.717496
cotau tm M3 74.339725 9.3057045
cotau tm P3 140.9875625 9.669985
cotau tm P3 207.70291 18.3928405
cotau tm P4 316.719723 18.346478
cotau tm P4 120.7608955 10.5045175
cotau tm P4 85.5654495 8.967917
cotau tm P4 135.870486 4.291884
cotau tm P4 290.9868405 23.3801685
cotau tm P4 160.526826 9.0142805
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.