Hi folks, sorry if this has been answered before, I searched long and hard before deciding to make a thread. I'm trying to include multiple variables in a non-parametric analysis (hah!). So far what I've managed to figure out is that the NPMC package from CRAN MIGHT be able to do what I need, but I can't get it to. First I created a dataset as NPMC calls for.> Ind=Individual | <- predictor > D=Day | <- predictor > S=Sex | <- predictor > hand = handlingtotal | <- response > occy.df<-data.frame(hand,Ind,D,S)Then I checked the classes of each variable (factor, integer, factor, numeric from top to bottom). Ok, go!> npmc(occy.ds)But alas, I get this error: Error in `$<-.data.frame`(`*tmp*`, "class", value = integer(0)) : replacement has 0 rows, data has 48 I thought maybe this was a problem to do with Day being an integer (seeing as it mentions integer in the error message), but no dice. Can any R-guru's out there please share their wisdom and apply some magic to solving this problem? The world of non-parametric analysis is somewhere I didn't willingly blunder into, but now that I'm here I'm in over my head, and any help you can throw my way would be super super appreciated. Kind regards, Dean. -- View this message in context: http://r.789695.n4.nabble.com/NPMC-replacement-has-0-rows-multiple-comparisons-tp3316788p3316788.html Sent from the R help mailing list archive at Nabble.com.
Peter Ehlers
2011-Feb-21 13:36 UTC
[R] NPMC - replacement has 0 rows (multiple comparisons)
On 2011-02-20 20:02, Karmatose wrote:> > Hi folks, sorry if this has been answered before, I searched long and hard > before deciding to make a thread. > > I'm trying to include multiple variables in a non-parametric analysis > (hah!). So far what I've managed to figure out is that the NPMC package from > CRAN MIGHT be able to do what I need, but I can't get it to. > > First I created a dataset as NPMC calls for. > >> Ind=Individual |<- predictor >> D=Day |<- predictor >> S=Sex |<- predictor >> hand = handlingtotal |<- response >> occy.df<-data.frame(hand,Ind,D,S) > > Then I checked the classes of each variable (factor, integer, factor, > numeric from top to bottom). > > Ok, go! >> npmc(occy.ds) > > But alas, I get this error: > Error in `$<-.data.frame`(`*tmp*`, "class", value = integer(0)) : > replacement has 0 rows, data has 48How is npmc() to know what is your response and what is your classification variable? The help page indicates that you must use the name 'var' for the response and 'class' for the predictor and, yes, only one predictor seems to be handled. You might be able to combine your predictors meaningfully into a single classification variable. While the help page cites a reference article, they unhelpfully neglect to provide journal information. Googling suggests that it is Biometrical Journal 43:553-569 (2001). Peter Ehlers> > I thought maybe this was a problem to do with Day being an integer (seeing > as it mentions integer in the error message), but no dice. Can any R-guru's > out there please share their wisdom and apply some magic to solving this > problem? The world of non-parametric analysis is somewhere I didn't > willingly blunder into, but now that I'm here I'm in over my head, and any > help you can throw my way would be super super appreciated. > > Kind regards, > Dean.
Mark Difford
2011-Feb-21 16:20 UTC
[R] NPMC - replacement has 0 rows (multiple comparisons)
On 2011-02-20 20:02, Karmatose wrote:>> I'm trying to include multiple variables in a non-parametric analysis >> (hah!). So far what I've managed to >> figure out is that the NPMC package from CRAN MIGHT be able to do what I >> need...Also look at packages nparcomp and coin (+ multcomp). Both use the formula interface. For the coin+multcomp combo look at the example at the bottom of the help page for kruskal_test. Regards, Mark. -- View this message in context: http://r.789695.n4.nabble.com/NPMC-replacement-has-0-rows-multiple-comparisons-tp3316788p3317629.html Sent from the R help mailing list archive at Nabble.com.