0

is there any way to hide the quadratic/polynomial terms in the regression output? It seems to show them by default which adds tons of rows, obviously. Thanks so much! Best Clemens

C_Hut
  • 31
  • 8
  • 1
    It's not clear how you expect us to answer this question. Need many more details. – IRTFM Aug 27 '21 at 21:15
  • 1
    please take a moment and read this article https://stackoverflow.com/help/how-to-ask about how to asking questions also read this article https://stackoverflow.com/help/minimal-reproducible-example about how to ask a good question with minimum requirement. – nima Aug 29 '21 at 05:28

1 Answers1

2

The developer answered this elsewhere:

https://github.com/strengejacke/sjPlot/issues/776#issuecomment-944883019

The next update will include keep and drop arguments, that are a bit more flexible and allow you to define regular expression patterns like this:

library(sjPlot)

# load mtcars data
data(mtcars)

# factorize cyl variable
mtcars$cyl.f <- factor(mtcars$cyl, ordered=TRUE)

# set polynomial contrast for factorized cyl
contrasts(mtcars$cyl.f) = contr.poly(3)

# run linear regression model
m <- lm(mpg ~ cyl.f, data=mtcars)

# include all polynomials
tab_model(m, keep ="\\.f")

# remove all polynomials
tab_model(m, drop ="\\.f")
C_Hut
  • 31
  • 8