similar to: using functions with multiple arguments in the "apply" family

Displaying 20 results from an estimated 3000 matches similar to: "using functions with multiple arguments in the "apply" family"

2010 Feb 24
1
extracting results from wilcox_test (package::coin)
Recently, I ran a series of Kruskal-Wallace tests [kruskal.test()] using by() to group by site Output is a list: >Herb.KW Herb.df$ID: 10-1 Kruskal-Wallis rank sum test data: Indicator_Rating by Year Kruskal-Wallis chi-squared = 15.24, df = 7, p-value = 0.03302 ----------------------------------------------------------------------------------------------------- Herb.df$ID: 18-1
2010 Feb 18
2
Extracting values from a list
I have run a kruskal.test() using the by() function, which returns a list of results like the following (subset of results): Herb.df$ID: 4-2 Kruskal-Wallis chi-squared = 18.93, df = 7, p-value = 0.00841 -------------------------------------------------------------------- Herb.df$ID: 44-1 Kruskal-Wallis chi-squared = 4.43, df = 6, p-value = 0.6187 So then, how do extract a vector
2010 Aug 03
3
Kruskal Walllis test
Hi all My data table (g) contains a continues data column (plant.height) and other columns (columns 8 to 57), each with number of levels of different factors. ANOVA test was done and the p-values were extracted as follos: a <- function(x) anova(lm(plant.height ~ x))$"Pr(>F)"[1] r<- apply(g[,8:57],2,a) If I try to do a Kruskal-Wallis test : kw <- function(x)
2008 Nov 12
2
creating a file of p.values
Hi all, I am performing hundreds of kruskal wallis tests and trying to figure out how to create a file of the p.values I obtain. This is the code I use for the tests: A2<-kruskal.test(X2~treatment) A3<-kruskal.test(X3~treatment) A4<-kruskal.test(X4~treatment) A5<-kruskal.test(X5~treatment) A6<-kruskal.test(X6~treatment) A7<-kruskal.test(X7~treatment)
2008 Oct 22
1
Saving kruskal wallis p-values
Hi everyone, I am working on analyzing spectra which requires hundreds of kruskal wallis tests to be performed. Once significant results are found post tests are performed ect. My questions are: how do I perform all these kw tests and save just the pvalues in a table? Is there anyway to have R automatically perform post tests if a result of p<0.05 is found? Currently when I run the test
2012 Jun 11
1
Kruskal Wallis Post hoc
Hi, I have searched and found a response to a question similar to mine but when I tried the code, R says it's not an actual function so I thought I'd ask here. http://r.789695.n4.nabble.com/file/n4633035/Cookies.csv Cookies.csv I have attached the data I am using. I am trying to look at two things: how moisture content changes over time, and how it changes along the length of a log
2010 Oct 27
1
(no subject)
I am interested in using "multcompLetters" after running "kruskalmc" but I'm a newbie and I'm not having luck figuring it out. I can run "kruskalmc" just fine, but after studying the documentation for "multcompletters" for a long time, I cannot figure out how to make it work. Any ideas? R input is below > >> #here is my data set >>
2011 Mar 29
2
List extraction
I have created a list of tables with the same columns but different number of row. Example (actual list has ~200 elements): > temp1<- data.frame(ID=c("Herb","Shrub"),stat=c(4,5),pvalue=c(.03,.04)) > temp2<- data.frame(ID=c("Herb","Shrub", > "Tree"),stat=c(12,15,13),pvalue=c(.2,0.4,.3)) > L<-list(a=temp1,b=temp2) > L $a
2005 Jan 17
5
find source code
I am using R 2.0.2 on a WinXP I am trying to get the code of the Kruskal-Wallis test but > kruskal.test function (x, ...) UseMethod("kruskal.test") <environment: namespace:stats> > ls(3) [1] "acf" "acf2AR" "add.scope" .............. [181] "kruskal.test" "ks.test"
2012 Jan 10
4
2 sample wilcox.test != kruskal.test
Hello, I think I am right in saying that a 2 sample wilcox.test is equal to a 2 sample kruskal.test and a 2 sample t.test is equal to a 2 sample anova. This is also stated in the ?kruskal.test man page: The Wilcoxon rank sum test (wilcox.test) as the special case for two samples; lm together with anova for performing one-way location analysis under normality assumptions; with Student's t
2008 Aug 21
1
Kruskal.test() on lists
Hi, I am trying to do a kruskal wallis test on two lists, fVisited and cSN: fVisited[[1]] [1] 0.17097623 0.30376141 0.17577266 0.14951855 0.03959753 0.08096217 0.05744888 0.02196257.... .... cSN[[1]] [1] 0.08557303 0.36477791 0.19601252 0.12981040 0.05351320 0.10385542 0.03539577 0.03106175.... So if I just want to do a test on just one of the entries this is simple enough:
2013 Jul 09
1
Kruskal.test
Hi, ?kruskal.test() ?a<- c(2,4,5,2,7) ?b<- c(2,2,6) ?c<- c(3,7,9,3) ?kruskal.test(list(a,b,c)) # ?#? Kruskal-Wallis rank sum test # #data:? list(a, b, c) #Kruskal-Wallis chi-squared = 2.003, df = 2, p-value = 0.3673 A.K. Hi I need an expression in R to apply a kruskal.test to this data (for example). a ? a ? a ? a ? ?a ? ?b ? b ? ?b ? ?c ? ?c ? c ? ?c 2 ?4 ? ?5 ? 2 ? ?7 ? ?2 ? 2 ?
2013 Apr 15
1
Kruskal-Wallis
Hi, I have got two groups of samples; and for every row, I wish to calculate Kruskal-Wallis' p-value. In the example below, and the stars (****) show where I am struggling to design and put things together. Any help would be appreciated. myFile <- data.frame(Sample_1a = 1:10, Sample_1b = 2:11, Sample_1c = 3:12, Sample_2a=4:13, Sample_2b=7:16, row.names=LETTERS[1:10]) groups <- rep
2006 Nov 20
1
sem package subscript out of bounds error
I'm having the most curious error while using the sem package. For the model I'm working with, I keep getting the following error: Error in J[cbind(1:n, observed)] <- 1 : subscript out of bounds I''ve used debug=TRUE with sem, and there don't appear to be any problems with model - there are no latent variables in this model. The variables in the covariance matrix
2018 Apr 23
3
Bug 16719: kruskal.test documentation for formula
I submit a couple options for addressing bug 16719: kruskal.test documentation for formula. https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16719 disallow-character.diff changes the documentation and error message to indicate that factors are accepted. allow-character.diff changes the kruskal.test functions to convert character vectors to factors; documentation is updated accordingly. I
2008 Mar 24
2
Newbie help with Sweave
I think I've gotten my Emacs/Sweave/R system set up correctly, thanks to Vincent and Jim, but I haven't been successful getting my first document produced. I'm trying to use one of Friedrich Leisch's examples, http://www.ci.tuwien.ac.at/~leisch/Sweave/example-1.Snw. I cut and pasted the text into a document sweaveexample.Rnw in Emacs. It seemed to be processed successfully with R:
2009 Sep 07
1
Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2
Hi all, The Kruskal-Wallis test is a generalization of the two-sample Mann-Whitney test to *k* samples. That being the case, the Kruskal-Wallis test with *k*=2 should give an identical p-value to the Mann-Whitney test, should it not? x1<-c(1:5) x2<-c(6,8,9,11) a<-wilcox.test(x1,x2,paired=FALSE) b<-kruskal.test(list(x1,x2),paired=FALSE) a$p.value [1] 0.01587302 b$p.value [1]
2013 Mar 10
1
kruskal test
Hi I need to test scores from questionnaires ADDQoL by age group by Kruskal test. But he wrote me: kruskal.test (wis1 ~ vekkat) Error in kruskal.test.default (c (-2, -4, 0, -1, -1, -3, 0, -4, 0, -1, 0,: all group levels must be finite Vekkat is as.factor and wis1 is as.nuemric How to remove this error? Please advise me. Thank you [[alternative HTML version deleted]]
2008 Oct 16
2
Saving results of Kruskal Walis test
Hello, I am running Kruskal-Walis test in R. When I try to save results using write.table it gives me the following error : Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) : cannot coerce class "htest" into a data.frame The overall code is as follows : >data_file = read.table("~/DATA.dir/data_file.txt", header=T)
2006 Mar 04
1
Npmc for doing post-hoc after Kruskal
I followed the threads that enquired about doing post-hoc tests after doing Kruskal testing. It took me to npmc. But npmc is giving an output I do not understand. I noticed a thread entitled "npmc function: 'x' must be atomic" but there never appeared to be a resolution. > npmc(npmcinput) Error in sort(unique.default(x), na.last = TRUE) : 'x' must be atomic