[R] NPMC - replacement has 0 rows (multiple comparisons)
Peter Ehlers
ehlers at ucalgary.ca
Mon Feb 21 14:36:57 CET 2011
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 48
How 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.
More information about the R-help
mailing list