Questions tagged [visreg]
20 questions
5
votes
1 answer
How to change axis labels using with visreg along with ggplot2
I'm using the visreg package with gg = TRUE (so it'll use ggplot2 graphics) to render my fitted model plots.
It automatically uses the names of the independent variable factors as the x axis labels, but I need them to appear slightly differently…

Hohl
- 51
- 1
- 3
3
votes
1 answer
Controlling facet column number with visreg
While I am enjoying using package visreg to visualize my regressions, there's one thing that I can't yet control: the number of columns when faceting. See the following factor-by-curve generalized additive regression for…

Kim
- 4,080
- 2
- 30
- 51
2
votes
1 answer
Is there a way to rotate the x-axis labels in the visreg package?
*** EDIT **** Figured it out: scales = list(rot = 90)
I am using the visreg() function to plot a linear model comparing bird weights between years. I have three different species, so the graph is very crowded. I want to rotate the x-axis labels so…

emmz
- 45
- 4
2
votes
0 answers
Visreg for GLM in R: singular matrix 'a' in 'solve' Error message
I'm fairly new to R but have so far been managing to use it for my master's thesis.
Having run the following GLM:
M1 <- glm.nb(abundance ~ temp * fseason * fperiod * fregion
+ offset(LogRSize) + offset(LogPLength) +…

Matt Livesey
- 21
- 2
2
votes
0 answers
Convert model averaging results from MuMin to plot in visreg or effects packages
I'm using MuMin to perform model averaging using glmmTMB to build the global model, which all works fine.
I would then like to produce effect displays of results using the visreg or effects package. Both of these work fine on regular models produced…

Rich_b
- 21
- 1
2
votes
1 answer
Changing visreg line colour
I'm using the R package visreg to visualise the results of a model. I want to change the colour of the regression line from the default blue to black. Adding col = "black" doesn't help. How do I make this change?
Thanks!

pratikunterwegs
- 73
- 7
1
vote
1 answer
Visreg Plotting log-log as log-level
I want to run a regression of money spent on links clicked using a data set where I notice link clicks level off after a certain amount of money spent. I want to use a log transformation to better fit this leveling-off data.
My data set looks like…

Henry Walsh
- 11
- 1
1
vote
0 answers
Are outliers affecting the shape of my logistic regression curve or is it the fact the samples are unbalanced?
I am trying to carry out logistic regression on a dataset. I have converted Age (categorical variable) to binary (0 = "Adult", 1 = "Immature"). Tail length is a continuous numerical variable and I want to predict the probability that an animal with…

emmz
- 45
- 4
1
vote
0 answers
Plotting logistic model with package visreg doesn´t work Data not found
My second question of the day: I want to use the visreg package to plot my logistic regression models. As long as I don't use the attribute "by" it works like a charm, but when I want to use it I get an error. The code I used to create my model is…

jan
- 23
- 3
1
vote
0 answers
How to get only 1 specific cross section of a Visreg plot or how to select/subset only 1 faceted plot in a gg object?
I am running a logistic regression to get the probability of something at certain inputs. I'll use an example:
I want to predict someone's chance to be admitted to a graduate school based on their GRE and GPA.
Using the visreg package, it produces…

rof
- 11
- 2
1
vote
1 answer
How to backtransform squareroot transformed data in visreg in R
I've been trying to backtransfrom my squareroot transformed data in visreg in R but I can't find the right command for trans=. In the visreg guidance it only discusses using trans=exp to backtransform log transformed data. How do I specify I want to…

Heather Hickman
- 11
- 3
1
vote
0 answers
Recreate visreg() data ticks in border using ggplot()
I would like to recreate the data ticks found in the border of visreg() logistic regression plots using ggplot().
I can get the data points plotted with geom_point(), but these are in the axis space, and I would like to get them in the…

Roasty247
- 679
- 5
- 20
0
votes
1 answer
How to plot predicted response and 95%CIs using visreg function if I have rescaled my regressors?
Is there any way to make a conditional plot using visreg fucntion when I have scaled my regressors?
I want to plot my rescaled response along with 95%CIs, prediction curve, and partial residuals.
install.packages("lme4")
library("lme4")
y <-…

Sergio Nolazco
- 159
- 9
0
votes
0 answers
How to plot rescaled predicted response and 95% CIs using visreg package?
I am trying to plot a conditional plot using the visreg function but my original model have all predictors scaled using scale(). Is it possible to rescale the prediction curve and 95% CIs to make the plot while using the visreg()…

Sergio Nolazco
- 159
- 9
0
votes
1 answer
How to make a plot with partial residuals using the 'visreg' function when my model is a 'glmmTMB' object with offsets?
I am having some trouble trying to make a conditional plot using the 'visreg' function. My model is a zero-inflated negative binomial regression built using the 'glmmTMB' function and it includes an offset.
Why the partial residuals are so far away…

Sergio Nolazco
- 159
- 9