bwtrim | R Documentation |

The `bwtrim`

function computes a two-way between-within subjects ANOVA on the trimmed means. It is designed for one between-subjects variable and one within-subjects variable. The functions `sppba`

, `sppbb`

, and `sppbi`

compute the main fixed effect, the main within-subjects effect, and the interaction effect only, respectively, using bootstrap. For these 3 functions the user can choose
an M-estimator for group comparisons.

```
bwtrim(formula, id, data, tr = 0.2, ...)
tsplit(formula, id, data, tr = 0.2, ...)
sppba(formula, id, data, est = "mom", avg = TRUE, nboot = 500, MDIS = FALSE, ...)
sppbb(formula, id, data, est = "mom", nboot = 500, ...)
sppbi(formula, id, data, est = "mom", nboot = 500, ...)
```

`formula` |
an object of class formula. |

`id` |
subject ID. |

`data` |
an optional data frame for the input data. |

`tr` |
trim level for the mean. |

`est` |
Estimate to be used for the group comparisons: either |

`avg` |
If |

`nboot` |
number of bootstrap samples. |

`MDIS` |
if |

`...` |
currently ignored. |

The `tsplit`

function is doing exactly the same thing as `bwtrim`

. It is kept in the package in order to be consistent with older versions of the Wilcox (2012) book.
For `sppba`

, `sppbb`

, and `sppbi`

the analysis is carried out on the basis of all pairs of difference scores. The null hypothesis is that all such differences have a robust location value of zero. In the formula interface it is required to specify full model.

`bwtrim`

returns an object of class `"bwtrim"`

containing:

`Qa` |
first main effect |

`A.p.value` |
p-value first main effect |

`A.df` |
df F-distribution first main effect |

`Qb` |
second main effect |

`B.p.value` |
p-value second main effect |

`B.df` |
df F-distribution second main effect |

`Qab` |
interaction effect |

`AB.p.value` |
p-value interaction effect |

`AB.df` |
df F-distribution interaction |

`call` |
function call |

`varnames` |
variable names |

`sppba`

, `sppbb`

, and `sppbi`

returns an object of class `"spp"`

containing:

`test` |
value of the test statistic |

`p.value` |
p-value |

`contrasts` |
contrasts matrix |

Wilcox, R. (2017). Introduction to Robust Estimation and Hypothesis Testing (4th ed.). Elsevier.

`t2way`

```
## data need to be on long format
pictureLong <- reshape(picture, direction = "long", varying = list(3:4), idvar = "case",
timevar = c("pictype"), times = c("couple", "alone"))
pictureLong$pictype <- as.factor(pictureLong$pictype)
colnames(pictureLong)[4] <- "friend_requests"
## 2-way within-between subjects ANOVA
bwtrim(friend_requests ~ relationship_status*pictype, id = case, data = pictureLong)
## between groups effect only (MOM estimator)
sppba(friend_requests ~ relationship_status*pictype, case, data = pictureLong)
## within groups effect only (MOM estimator)
sppbb(friend_requests ~ relationship_status*pictype, case, data = pictureLong)
## interaction effect only (MOM estimator)
sppbi(friend_requests ~ relationship_status*pictype, case, data = pictureLong)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.