0

I am trying to conduct a robust ANCOVA with 1 grouping variable/factor with 4 levels and one continuous covariate.

Is anyone aware of functions that can execute this?

ancova() from WRS2 only takes 2 levels, and when I try to install the older WRS (as suggested here https://stats.stackexchange.com/questions/276697/how-to-implement-a-robust-ancova-with-more-than-2-groups-in-r) , I get this warning:

Warning in install.packages : package ‘WRS’ is not available (for R version 3.6.0)` .

Capt.Krusty
  • 597
  • 1
  • 7
  • 26
Cassandra
  • 137
  • 1
  • 9
  • 1
    The first part of your question is off-topic, since package recommendations are not allowed here. The second part of your question is off-topic, as it pertains statistical methodology, not programming, and is therefore better suited at stats.stackexchange.com. – Axeman Jun 26 '19 at 23:17
  • My mistake, I wasn't aware. I have edited the question. – Cassandra Jun 26 '19 at 23:52
  • `WRS` is probably archived, but I can't check the archive because `r-project.org` appears to be down. So `install.packages("WRS", repos="http://R-Forge.R-project.org", type="source")` is also not working right now. – Axeman Jun 27 '19 at 00:33

1 Answers1

1

In case you would still like to conduct a robust ANCOVA with more than two groups here is how to do it:

# load the latest WRS package
> source("https://dornsife.usc.edu/assets/sites/239/docs/Rallfun-v38.txt")

# pairwise comparisons for independent groups with one covariate:

ancmg1(x,y, op=3, tr=0.2)

where x is a list with covariate values for each group and y a list of DV values for each group and op is:

op=1 use omnibus test for trimmed means, with trimming given by tr.

op=2 use omnibus test for medians.(Not recommended when there are tied values, use op=4)

op=3 multiple comparisons using trimming and percentile bootstrap. This method seems best for general use.

op=4 multiple comparisons using medians and percentile bootstrap

If your data is in long format the easiest way how to prepare x and y is to use split:

x <- split(yourCovariate, list(Group))
y <- split(yourDV, list(Group))
Jan
  • 146
  • 2
  • 1
    Sourcing an unknown file it is not a good practice. Please, could you provide CRAN or Github link to WRS package? There is a new WRS2 package in [CRAN](https://CRAN.R-project.org/package=WRS2 ) but no function `ancmg1()` in it – josep maria porrà Aug 26 '21 at 17:32
  • 1
    This is not an unknown file. It is a university link to the latest Rand Willcox's collection of robust functions upon which the WRS (Wilcox Robust Statistics) package is based. – Jan Aug 26 '21 at 21:17