Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.62 KB | None | 0 0
  1.  
  2. R version 3.4.3 (2017-11-30) -- "Kite-Eating Tree"
  3. Copyright (C) 2017 The R Foundation for Statistical Computing
  4. Platform: x86_64-pc-linux-gnu (64-bit)
  5.  
  6. R is free software and comes with ABSOLUTELY NO WARRANTY.
  7. You are welcome to redistribute it under certain conditions.
  8. Type 'license()' or 'licence()' for distribution details.
  9.  
  10. R is a collaborative project with many contributors.
  11. Type 'contributors()' for more information and
  12. 'citation()' on how to cite R or R packages in publications.
  13.  
  14. Type 'demo()' for some demos, 'help()' for on-line help, or
  15. 'help.start()' for an HTML browser interface to help.
  16. Type 'q()' to quit R.
  17.  
  18. > source('/home/pw/wessanet/cretab')
  19. >
  20. >
  21. >
  22. > myrfcuid = 'account3'
  23. >
  24. > x <- array(list(0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'B'",0,"'S'",1,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'B'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",1,"'S'",0,"'S'",1,"'B'",1,"'S'",0,"'S'",1,"'B'",1,"'B'",1,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",1,"'S'",0,"'S'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",0,"'S'",0,"'S'",1,"'B'",0,"'S'",1,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'S'",1,"'B'",1,"'S'",0,"'S'",1,"'B'",1,"'B'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",1,"'B'",0,"'S'",0,"'S'",1,"'S'",0,"'S'",0,"'S'",0,"'S'",1,"'B'",0,"'S'",1,"'B'",0,"'S'",1,"'B'",1,"'S'",0,"'S'",1,"'B'",0,"'S'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",0,"'S'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",0,"'S'",1,"'B'",1,"'B'",1,"'B'",1,"'B'",1,"'S'",1,"'B'",1,"'B'",1,"'B'",0,"'S'",0,"'S'",0,"'S'",1,"'B'",1,"'B'",1,"'S'",1,"'S'",1,"'B'",1,"'S'",1,"'B'",1,"'B'",0,"'S'",1,"'B'",0,"'S'",0,"'S'",1,"'B'",1,"'B'",0,"'S'",0,"'S'",0,"'S'",0,"'B'",0,"'S'",0,"'S'",1,"'B'",1,"'B'"),dim=c(2,179),dimnames=list(c('spssC','groupC'),1:179))
  25. > y <- array(NA,dim=c(2,179),dimnames=list(c('spssC','groupC'),1:179))
  26. > for (i in 1:dim(x)[1])
  27. + {
  28. + for (j in 1:dim(x)[2])
  29. + {
  30. + y[i,j] <- as.numeric(x[i,j])
  31. + }
  32. + }
  33. There were 50 or more warnings (use warnings() to see the first 50)
  34. > par3 = 'TRUE'
  35. > par2 = '2'
  36. > par1 = '1'
  37. > ylab = 'Y Variable Name'
  38. > xlab = 'X Variable Name'
  39. > main = 'Title Goes Here'
  40. > par3 <- 'TRUE'
  41. > par2 <- '2'
  42. > par1 <- '1'
  43. > #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Sun, 16 Jul 2017 09:52:59 +0200)
  44. > #Author: root
  45. > #To cite this work: Ian E. Holliday (2017), One-Way-Between-Groups ANOVA (v1.0.6) in Free Statistics Software (v$_version), Office for Research Development and Education, URL https://www.wessa.net/rwasp_One%20Factor%20ANOVA.wasp/
  46. > #Source of accompanying publication:
  47. > #
  48. > cat1 <- as.numeric(par1) #
  49. > cat2<- as.numeric(par2) #
  50. > intercept<-as.logical(par3)
  51. > x <- t(x)
  52. > x1<-as.numeric(x[,cat1])
  53. > f1<-as.character(x[,cat2])
  54. > xdf<-data.frame(x1,f1)
  55. > (V1<-dimnames(y)[[1]][cat1])
  56. [1] "spssC"
  57. > (V2<-dimnames(y)[[1]][cat2])
  58. [1] "groupC"
  59. > names(xdf)<-c('Response', 'Treatment')
  60. > if(intercept == FALSE) (lmxdf<-lm(Response ~ Treatment - 1, data = xdf) ) else (lmxdf<-lm(Response ~ Treatment, data = xdf) )
  61.  
  62. Call:
  63. lm(formula = Response ~ Treatment, data = xdf)
  64.  
  65. Coefficients:
  66. (Intercept) Treatment'S'
  67. 0.9592 -0.7207
  68.  
  69. > (aov.xdf<-aov(lmxdf) )
  70. Call:
  71. aov(formula = lmxdf)
  72.  
  73. Terms:
  74. Treatment Residuals
  75. Sum of Squares 18.48511 25.52606
  76. Deg. of Freedom 1 177
  77.  
  78. Residual standard error: 0.3797565
  79. Estimated effects may be unbalanced
  80. > (anova.xdf<-anova(lmxdf) )
  81. Analysis of Variance Table
  82.  
  83. Response: Response
  84. Df Sum Sq Mean Sq F value Pr(>F)
  85. Treatment 1 18.485 18.4851 128.18 < 2.2e-16 ***
  86. Residuals 177 25.526 0.1442
  87. ---
  88. Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  89. >
  90. > a<-table.start()
  91. > a<-table.row.start(a)
  92. > a<-table.element(a,'ANOVA Model', length(lmxdf$coefficients)+1,TRUE)
  93. > a<-table.row.end(a)
  94. > a<-table.row.start(a)
  95. > a<-table.element(a, paste(V1, ' ~ ', V2), length(lmxdf$coefficients)+1,TRUE)
  96. > a<-table.row.end(a)
  97. > a<-table.row.start(a)
  98. > a<-table.element(a, 'means',,TRUE)
  99. > for(i in 1:length(lmxdf$coefficients)){
  100. + a<-table.element(a, round(lmxdf$coefficients[i], digits=3),,FALSE)
  101. + }
  102. > a<-table.row.end(a)
  103. > a<-table.end(a)
  104. > table.save(a,file="/home/pw/wessanet/rcomp/tmp/1ep9j1516787005.tab")
  105. > a<-table.start()
  106. > a<-table.row.start(a)
  107. > a<-table.element(a,'ANOVA Statistics', 5+1,TRUE)
  108. > a<-table.row.end(a)
  109. > a<-table.row.start(a)
  110. > a<-table.element(a, ' ',,TRUE)
  111. > a<-table.element(a, 'Df',,FALSE)
  112. > a<-table.element(a, 'Sum Sq',,FALSE)
  113. > a<-table.element(a, 'Mean Sq',,FALSE)
  114. > a<-table.element(a, 'F value',,FALSE)
  115. > a<-table.element(a, 'Pr(>F)',,FALSE)
  116. > a<-table.row.end(a)
  117. > a<-table.row.start(a)
  118. > a<-table.element(a, V2,,TRUE)
  119. > a<-table.element(a, anova.xdf$Df[1],,FALSE)
  120. > a<-table.element(a, round(anova.xdf$'Sum Sq'[1], digits=3),,FALSE)
  121. > a<-table.element(a, round(anova.xdf$'Mean Sq'[1], digits=3),,FALSE)
  122. > a<-table.element(a, round(anova.xdf$'F value'[1], digits=3),,FALSE)
  123. > a<-table.element(a, round(anova.xdf$'Pr(>F)'[1], digits=3),,FALSE)
  124. > a<-table.row.end(a)
  125. > a<-table.row.start(a)
  126. > a<-table.element(a, 'Residuals',,TRUE)
  127. > a<-table.element(a, anova.xdf$Df[2],,FALSE)
  128. > a<-table.element(a, round(anova.xdf$'Sum Sq'[2], digits=3),,FALSE)
  129. > a<-table.element(a, round(anova.xdf$'Mean Sq'[2], digits=3),,FALSE)
  130. > a<-table.element(a, ' ',,FALSE)
  131. > a<-table.element(a, ' ',,FALSE)
  132. > a<-table.row.end(a)
  133. > a<-table.end(a)
  134. > table.save(a,file="/home/pw/wessanet/rcomp/tmp/2jxd31516787005.tab")
  135. > postscript(file="/home/pw/wessanet/rcomp/tmp/3cwo81516787005.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
  136. > boxplot(Response ~ Treatment, data=xdf, xlab=V2, ylab=V1)
  137. > dev.off()
  138. null device
  139. 1
  140. > if(intercept==TRUE){
  141. + 'Tukey Plot'
  142. + thsd<-TukeyHSD(aov.xdf)
  143. + postscript(file="/home/pw/wessanet/rcomp/tmp/43suu1516787005.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
  144. + plot(thsd)
  145. + dev.off()
  146. + }
  147. null device
  148. 1
  149. > if(intercept==TRUE){
  150. + a<-table.start()
  151. + a<-table.row.start(a)
  152. + a<-table.element(a,'Tukey Honest Significant Difference Comparisons', 5,TRUE)
  153. + a<-table.row.end(a)
  154. + a<-table.row.start(a)
  155. + a<-table.element(a, ' ', 1, TRUE)
  156. + for(i in 1:4){
  157. + a<-table.element(a,colnames(thsd[[1]])[i], 1, TRUE)
  158. + }
  159. + a<-table.row.end(a)
  160. + for(i in 1:length(rownames(thsd[[1]]))){
  161. + a<-table.row.start(a)
  162. + a<-table.element(a,rownames(thsd[[1]])[i], 1, TRUE)
  163. + for(j in 1:4){
  164. + a<-table.element(a,round(thsd[[1]][i,j], digits=3), 1, FALSE)
  165. + }
  166. + a<-table.row.end(a)
  167. + }
  168. + a<-table.end(a)
  169. + table.save(a,file="/home/pw/wessanet/rcomp/tmp/541j61516787005.tab")
  170. + }
  171. > if(intercept==FALSE){
  172. + a<-table.start()
  173. + a<-table.row.start(a)
  174. + a<-table.element(a,'TukeyHSD Message', 1,TRUE)
  175. + a<-table.row.end(a)
  176. + a<-table.start()
  177. + a<-table.row.start(a)
  178. + a<-table.element(a,'Must Include Intercept to use Tukey Test ', 1, FALSE)
  179. + a<-table.row.end(a)
  180. + a<-table.end(a)
  181. + table.save(a,file="/home/pw/wessanet/rcomp/tmp/6r5ig1516787005.tab")
  182. + }
  183. > library(car)
  184. > lt.lmxdf<-leveneTest(lmxdf)
  185. > a<-table.start()
  186. > a<-table.row.start(a)
  187. > a<-table.element(a,'Levenes Test for Homogeneity of Variance', 4,TRUE)
  188. > a<-table.row.end(a)
  189. > a<-table.row.start(a)
  190. > a<-table.element(a,' ', 1, TRUE)
  191. > for (i in 1:3){
  192. + a<-table.element(a,names(lt.lmxdf)[i], 1, FALSE)
  193. + }
  194. > a<-table.row.end(a)
  195. > a<-table.row.start(a)
  196. > a<-table.element(a,'Group', 1, TRUE)
  197. > for (i in 1:3){
  198. + a<-table.element(a,round(lt.lmxdf[[i]][1], digits=3), 1, FALSE)
  199. + }
  200. > a<-table.row.end(a)
  201. > a<-table.row.start(a)
  202. > a<-table.element(a,' ', 1, TRUE)
  203. > a<-table.element(a,lt.lmxdf[[1]][2], 1, FALSE)
  204. > a<-table.element(a,' ', 1, FALSE)
  205. > a<-table.element(a,' ', 1, FALSE)
  206. > a<-table.row.end(a)
  207. > a<-table.end(a)
  208. > table.save(a,file="/home/pw/wessanet/rcomp/tmp/7trq61516787005.tab")
  209. >
  210. > try(system("convert /home/pw/wessanet/rcomp/tmp/3cwo81516787005.ps /home/pw/wessanet/rcomp/tmp/3cwo81516787005.png",intern=TRUE))
  211. character(0)
  212. > try(system("convert /home/pw/wessanet/rcomp/tmp/43suu1516787005.ps /home/pw/wessanet/rcomp/tmp/43suu1516787005.png",intern=TRUE))
  213. character(0)
  214. >
  215. > proc.time()
  216. user system elapsed
  217. 5.864 0.552 12.392
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement