[R] yuen function of the WRS2 package

James Henson jfhenson1 at gmail.com
Tue Aug 30 23:07:39 CEST 2016


Greetings R community,
Here is a small but perplexing problem with the ‘yuen’ function in the
‘WRS2’ package.
I begin with the ‘eurosoccer’ data frame from the ‘WRS2’ package.
Then make a subset that contains only two Leagues Spain and Germany
(subset data frame is ‘SpainGer’).   The ‘yuen’ function cannot read
the data in subset data frame ‘SpainGer’.  My code is below.
Thanks you for your help.
James F. Henson


# Examples from 'Robust Statistical Methods on R Using the WRS2 Package’
# Robust t-test, and ANOVA (pages5-13)
library(WRS2)
data("eurosoccer")
class(eurosoccer)
print(eurosoccer)
library("digest")
library("DT")
datatable(eurosoccer)
str(eurosoccer)
# make a subset with only Spain and Germany
SpainGer <- subset (eurosoccer, subset = League =="Spain" | League == "Germany")
print(SpainGer)
class(SpainGer)
str(SpainGer)
# The 'yuen' function can not read the data in the subset data.frame "SpainGer"
yuen(GoalsGame ~ League, tr=0.2, data = SpainGer)
# the 'yuen' function works on the orginioal data.frame
yuen(GoalsGame ~ League, tr=0.2, data = eurosoccer)
# the 'aov' function reads the data in the subset data.frame "SpainGer"
Goals.fit <- aov(GoalsGame ~ League, data = SpainGer)
summary(Goals.fit)



More information about the R-help mailing list