Hi All,
I stumbled upon some topics regarding interactions in anova and regression
and packages for tabulating and visualizations the results of them.
Here we are:
https://stackoverflow.com/questions/77933272/how-to-add-a-reference-level-for-interaction-in-gtsummary-and-sjplot/77935742#77935742
,
https://stackoverflow.com/questions/78016795/how-to-add-reference-levels-for-interaction-in-r?noredirect=1&lq=1
.
I was wondering because I usually use GUI software and these questions did
not get answers, if from a technical point of view
how to do it, using these (sjPlot, gtsummary) or other ways to make such
tables, inserting the reference levels of these mentioned interactions.
This is not likely to be used in publications (including three base
levels), but from the point of view of solving the topics this questions
have interested me.
I tried myself to make it happen, but so far without success.
I recall this reprex based on SO:

set.seed(1000)
my_data <- rbind(
  data.frame(time = "Pre", treatment = "Control", response =
rnorm(100, mean=1)),
  data.frame(time = "Pre", treatment = "Treatment", response =
rnorm(100, mean=2)),
  data.frame(time = "Post", treatment = "Control", response =
rnorm(100, mean=1)),
  data.frame(time = "Post", treatment = "Treatment", response =
rnorm(100, mean=2))
) %>% mutate(time = factor(time, levels = c("Pre", "Post")))
%>%mutate(treatment = factor(treatment, levels = c("Control",
"Treatment")))
model3 <- lm(response ~ time * treatment, data = my_data)

Thanks,
Jacek

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to