Stepwise regression using p-values to drop variables with nonsignificant p-values

Show your boss the following : set.seed(100) x1 <- runif(100,0,1) x2 <- as.factor(sample(letters[1:3],100,replace=T)) y <- x1+x1*(x2==”a”)+2*(x2==”b”)+rnorm(100) summary(lm(y~x1*x2)) Which gives : Estimate Std. Error t value Pr(>|t|) (Intercept) -0.1525 0.3066 -0.498 0.61995 x1 1.8693 0.6045 3.092 0.00261 ** x2b 2.5149 0.4334 5.802 8.77e-08 *** x2c 0.3089 0.4475 0.690 0.49180 x1:x2b -1.1239 0.8022 -1.401 0.16451 x1:x2c -1.0497 … Read more

Put stars on ggplot barplots and boxplots – to indicate the level of significance (p-value)

I know that this is an old question and the answer by Jens Tierling already provides one solution for the problem. But I recently created a ggplot-extension that simplifies the whole process of adding significance bars: ggsignif Instead of tediously adding the geom_line and geom_text to your plot you just add a single layer geom_signif: … Read more