Questions tagged [ancova]
46 questions
0
votes
1 answer
Separating categorical variables in a linear regression
I fit a linear model using two categorical variables and one numerical variable as follows:
data(iris)
iris2 <- iris %>%
mutate(petal_type= if_else(Petal.Length > 4, "petal_long", "petal_short"),
sepal_type = if_else(Sepal.Length > 6,…

phargart
- 655
- 3
- 14
0
votes
1 answer
Obtain F-ratio and p-value for the continuous predictor
I fitted a linear model with block as a fixed factor, plus 2 categorical and 1 continuous predictors. I'd like a Type III ANCOVA table with all the effects averaged over blocks.
dput(rye)
structure(list(strain = c("S23", "S23", "S23", "S23", "S23",…

hnguyen
- 772
- 6
- 17
0
votes
0 answers
Ran a MANOVA where Pillai's/Wilks isn't significant, but one of the DVs is very significant in my output table of between-subjects effects
I'm a stats newb and was told by my professor to run a MANOVA for something I was checking out. Basically, I wanted to see if there was an interaction between ethnicity and a certain quadrant grouping for a set of outcome variables that are…

kathax
- 71
- 2
0
votes
0 answers
post-hoc test of sm.ancova (non-parametric ancova)
I'm trying to use a non-parametric ancova on my data set.
Currently, I'm using package sm for the function sm.ancova
However, I'm not sure which post-hoc test I should be using for the data.
Would there be any recommended statistical test or a…

Changho Kim
- 7
- 5
0
votes
1 answer
R WRS ancova function: Error in if (nuhat < 2) stop("The degrees of freedom must be greater than or equal to 2")
I want to run a robust ANCOVA from the WRS2 package (https://rdrr.io/cran/WRS2/man/ancova.html). 'ratio' is my DV, 'bait' the predictor and 'session' the covariate.
I use the following function:
ancova_model = ancova(ratio ~ bait + session, data =…

Surstroemmingpirat
- 73
- 1
- 6
0
votes
1 answer
Is there a R function to perform an Ancova post-hoc test to check homogeneity of regression slopes
After adjust some linear models I want, first, to test for homogeneity of regression slopes. The second step, and here is my doubt, I want to employ a post-hoc test to compare slopes two by two.
Here goes an example modified from…

Antonio
- 563
- 1
- 5
- 12
0
votes
0 answers
Error when trying to find estimated marginal means in r
Im trying to do find the Estimated Marginal Means of some data but keep getting an error message.
# Pairwise comparisons
library(emmeans)
pwc <- df1 %>% emmeans_test(Y ~ C, covariate = M,
p.adjust.method = "bonferroni")
returns
> # Pairwise…

Zzzr124
- 1
0
votes
1 answer
Trying to interpret ANCOVA in R
here's a brief overview of what I'm trying to do. The dataset I have was collected from an experiment that compared 3 conditions (control, group 1 and group 2) on performance. My first task was to compare if there's a diff between gr1 vs control. I…

dquestions
- 19
- 3
0
votes
1 answer
Categorical covariate with two way anova in R
This is a random sample of my data set:
structure(list(DTI_ID = structure(c(31L, 241L, 84L, 298L, 185L,
269L, 198L, 24L, 286L, 177L, 228L, 158L, 57L, 293L, 218L, 8L,
180L, 39L, 211L, 134L, 291L, 309L, 99L, 70L, 154L, 138L, 250L,
41L, 276L, 262L,…

CanyonView
- 401
- 3
- 15
0
votes
2 answers
Problem in R: NAs introduced by coercion in a scatterplot
I am trying to create this
but in doing so R says the following:
In plot.xy(xy, type, ...) : NAs introduced by coercion`
I will attach my entire code below:
lnmass <- MoleRat$lnMass
lnenergy <- MoleRat$lnEnergy
caste <- MoleRat$caste
infrequent…

Tyler Brent de Leon
- 29
- 5
0
votes
1 answer
How to properly use lm() in R in order to run ANCOVA test?
I am currently working on a project in which I have to run an ANCOVA test with the data set integrated in R. (Iris)
I am trying to figure out how to set up lm() in order to run this test. I do not want the complete answer, as I really want to learn.…

Y_m5437
- 3
- 1
0
votes
0 answers
Discrepancies in robust ancova calculated in R with the WRS2 package vs by hand
I've conducted a study where participants in 2 groups (Control and Experimental) completed three scales (NJ, A, and D) at two time points (T1 and T2). I'm running ANCOVAs with the T2 responses as my dependent variables, T1 responses as my…

E Nielsen
- 1
- 1
0
votes
0 answers
Homoscedascity tests for Two-Way ANOVA (a factor and a covariate)
I have the following formula:
glm1 <- glm(y ~ g1 + g2, data = fish, family = binomial)
y is a binomial variable: num 1 1 0 0 1 0 0 0 0 1 ... #There is (1) or isn't (0) fish.
g1 : Factor w/ 4 levels "1","2","3","4": 1 2 1 1 4 1 2 1 1 3 ...…

Джимми Мартина
- 19
- 3
0
votes
0 answers
ANCOVA with afex in R: Error: Empty cells in between-subjects design, however no NA's
I am performing a factorial ANCOVA in R using aov_ez from the afex package. I have two binary covariates both coded as factors and dummies (0 and 1). There is no missing data in the dataset or in the covariate columns.
However, when I run aov_ez it…

EvaSahlholdt
- 3
- 3
0
votes
1 answer
R: programming nested random effect in gamm (gamcova)
I am trying to execute nested random effects in R with the mgcv::gamm function. Specifically, this function is supposedly an extension of ANCOVA to GAMM, resulting in a GAMMCOVA.
The reasoning for random effects: the entire dataset is composed of…

ecology
- 606
- 3
- 9
- 29