Questions tagged [ancova]

46 questions
3
votes
1 answer

create a table with looped anova results r

example of dataframe: > df ID B C D 1 A 1 1 3 2 B 2 3 1 3 C 1 1 1 4 D 3 1 1 5 E 1 0 0 I've looped anova on various variables on a dataframe with this code (found online) data:df library(car) LLA <- rep(NA, ncol…
2
votes
1 answer

How to explain the result of ANCOVA and linear regression

Currently I am learning ANCOVA, but I'm confused with the result. I created a linear regression model using mtcars like this: summary(lm(qsec ~ wt+factor(am), data = mtcars)) The output is: Call: lm(formula = qsec ~ wt + factor(am), data =…
Moliz
  • 43
  • 7
2
votes
0 answers

How to supply parameters for ancova in gtsummary

I'm trying to generate manuscript ready summary tables using gtsummary. I have a factor variable with 3 levels (1,2 and 3), and would like to estimate group-wise effects comparing groups 2 and 3 to the reference group (group 1). Here's a working…
2
votes
1 answer

Regression lines in ggplot

I have a 2 x 2 ancova with the resulting plot showing 4 regression lines and 4 groups in various colours on the plot. I wish to retain the 4 colours in the plot but only show 2 regression lines for one of the variables - not all 4 as shown. The data…
1
vote
0 answers

joint_tests omits covariate transformed with asin(sqrt()) via make.tran()

Relating to joint_tests doesn't recognize asin.sqrt transformation via make.tran() I have emmeans 1.8.8 set.seed(83) library(emmeans) dummy <- expand.grid( covar = runif(72, min = 0, max = 1), resp = runif(72, min = 0, max = 2), site = c("a",…
hnguyen
  • 772
  • 6
  • 17
1
vote
0 answers

Need for contrasts in ANCOVA?

I'm currently trying to compute an ANCOVA as follows: library(car) model <- aov(speed~car+engine, data = car_data) Anova(model, type="III") library("multcomp") m4 <- glht(car_data, linfct = mcp(car= "Tukey"), alternative =…
1
vote
1 answer

Steps after running a 3 way ANCOVA with 1 continuous covariate

I'm working on a 3 way ANCOVA in R. 3 categorical predictors, 1 non-negative continuous covariate, and 1 non-negative continuous response variable. I've worked through all the assumptions, omitted one extreme outlier, and I've gotten to the…
E10
  • 13
  • 4
1
vote
1 answer

afex in R: Error: Empty cells in within-subjects design (i.e., bad data structure). But the data structure is fine

I'm attempting to run an ANCOVA with 1 between-subjects variable and 2 within-subjects variables and I'm running into an error that makes no sense to me. My data looks like…
Mirscar
  • 67
  • 5
1
vote
0 answers

How to interpret a pre-post test ANCOVA result?

I have a basic pre-post trial design. Two randomized Groups and two tests for each participant in each group one prior to the intervention (here V1) and one post (V2). I am completely new to this and have been reading up a lot on this and based on a…
1
vote
1 answer

autoplot() in R for lm: why do I get a "Constant Leverage: Residuals vs Factor Levels" instead of a "Residuals vs Leverage" plot?

I am doing an ANCOVA in R with one continuous variable (DENSITY) and one factor (SEASON). When I check for the model assumptions I get a plot named: "Constant Leverage: Residuals vs Factor Levels" instead of the "Residuals vs Leverage"…
mararnold
  • 15
  • 3
1
vote
0 answers

Appropriate statistical test to analyze differences in slopes of time series data

I have created the following plot based on air quality data over three years of observation, and would like to know if these slopes are different across the two time periods (March-June 2018-2019 average vs. March-June 2020): A snapshot of my data…
Hp88
  • 23
  • 2
1
vote
1 answer

How to use stack() function correctly to extract marginal means of ANCOVA in R?

I'm a beginner of R, and I would like to extract marginal means from ANCOVA tests performed on over 200 outcome variables. It worked well when I only used stack() on only one outcome variable, but I got error when I use both stack() and…
Ella_may
  • 59
  • 7
1
vote
1 answer

How to extract marginal means of multiple variables with effect() function?

I'm a beginner of R, and I would like to perform ANCOVA in a dataset with over 200 columns of outcome variables. The most important thing for me is to extract both p values and marginal means of these variables. I successfully extracted p values…
Ella_may
  • 59
  • 7
1
vote
0 answers

two-way ANCOVA: Analysis of Covariance in LibreOffice Calc

Following this feature request, I want to know if/how I can have a macro to provide a simple GUI to do two-way ANCOVA (Analysis of Covariance) in Open/LibreOffice Calc. There is already an ANOVA tool in Calc, which does not comply with my…
0
votes
0 answers

Can I include covariates in a one-way repeated measures ANOVA? (ANCOVA?) What do results tell me?

I want to test the effect of a suicide prevention film on help-seeking. I have help-seeking intentions as an outcome variable and measured this variable at three time points (pre, post, follow-up) in 50 participants. To analyse the data I would…
1
2 3 4