Generation

generate functionSat, 29 Apr 2023

> posthoc <- glht(anova_result, linfct = mcp(Condition_SNB = "Tukey")) > summary(posthoc) Using R, please write me a code to create a table of these results to be copied and pasted in LateX

library(multcomp) library(lsmeans) #Generate data data <- data.frame( ID = 1:60, Condition_SNB = c(rep("A", 30), rep("B", 30)), SNB_Score = c(rnorm(30, 110, 10), rnorm(30, 100, 10)) ) #Perform the ANOVA anova_result <- lm(SNB_Score ~ Condition_SNB, data) #Perform the post hoc test posthoc <- glht(anova_result, linfct = mcp(Condition_SNB = "Tukey")) #Print out the table print(summary(posthoc))

Questions about programming?Chat with your personal AI assistant