0

I am trying to conduct a robust ANOVA including post-hoc test using WRS2 package in R. My data structure is as such: 1 dependent variable (res) 2 independent variables: between (group) - within (bla) 1 ID variable to refer to subjects (id)

My code looks like this:

fileHB=read.csv2("trial_II.csv");
fileHB$Hb=as.numeric(fileHB$Hb);

m1 <- WRS2::bwtrim(res ~ Group*Bla,id=id, data = fileHB)

Up until this point it works fine but when I try to check post hoc using this line of code:

sppba(res ~ Group*Bla,id,data = fileHB)

I receive the following error:

error in combn(levels(mf[, fixvar]), 2) : n < m

I don't know what to do here and I tried debugging but I cannot seem to find the error. I checked my data and everything is complete - so no missing data. Also, the indexing of subject etc. is correct. I would really aprreciate help on this issue.

I would be happy to get a response!

Best

2 Answers 2

0

I had the same error a while ago, try to covert the group as factor. For me tjos spmved my issue

fileHB$Group <- as.factor(fileHB$Group)

If not, another possibility is that you have some missing data so then your groups have not equal sizes. Then for me the posthoc didnt work and I had to do imputation but it depends on how would be your missing cases which type of strategy it is better for you.

Sign up to request clarification or add additional context in comments.

Comments

0

Hi the "sppba" function is not a post-hoc test. It is an omnibus test.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.