Skip to main content

Questions tagged [r]

Use this tag for any *on-topic* question that (a) involves `R` either as a critical part of the question or expected answer, & (b) is not *just* about how to use `R`.

Filter by
Sorted by
Tagged with
3 votes
1 answer
120 views

How should I handle a mass-point in the dependent variable when running OLS regression in R? I’m working with a a household expenditure dataset (Living Costs 2019) where the dependent variable is the ...
Jim's user avatar
  • 31
0 votes
0 answers
13 views

This is my first time attempting data imputation with the mice package. I've read some tutorials but am still confused about how to apply the different examples to ...
vcityx's user avatar
  • 1
0 votes
0 answers
32 views

I'm analyzing data on daily foraging dynamics of animals in different treatments feeding on a diet consisting of two different qualities (high and low) using R. The problem arises when there are days ...
Jason's user avatar
  • 41
1 vote
1 answer
39 views

I fit an ARIMAX model on the data here (this is annual copepod phenology influenced by seasonality of water temperature). Here is my model formula: ...
Grégwar's user avatar
0 votes
0 answers
32 views

I'm interested in calculating the required sample size for detecting a future hypothetical 30% increase in a marginal mean from a model based on pilot data (accounting for covariates and random ...
Nate's user avatar
  • 2,537
2 votes
1 answer
115 views

I’m trying to use the R poly() function with degree 1 to force glm to interpret a factor linearly. I’m puzzled by the fact that the size of the sample seems to increase the coefficient of the ...
Guillaume's user avatar
0 votes
0 answers
47 views

It appears to be possible to fit a GEE when the clustering levels are nested, but is it possible when they are not?
user500638's user avatar
1 vote
2 answers
66 views

Perhaps a silly question. I’m performing a likelihood ratio test in R using the mdscore package and the lr.test function, comparing a binary logistic regression model with one predictor to a null ...
burphound's user avatar
  • 109
3 votes
1 answer
76 views

For my experiment, I exposed fish to one of two treatments (n = 10 per treatment) and repeatedly measured their metabolic rate at seven different timepoints. Unfortunately, at the last time point, ...
EmilyW's user avatar
  • 33
8 votes
1 answer
172 views

I fitted a linear mixed model in R and tried to compute marginal means using emmeans, ggemmeans (from ggeffects), and ggpredict (also from ggeffects). The predicted means are similar, but the ...
Fmt's user avatar
  • 81
0 votes
0 answers
36 views

I am trying to perform a Monte-Carlo simulation on quantile regression using R. Currently I am getting stuck simulating the data from the model below. ...
UNI39's user avatar
  • 11
3 votes
1 answer
75 views

I'm analyzing an ecological dataset of nutrient concentrations (continuous) across seven stations (each station is nested within one of three sites). We also have ~60 samples from each station where ...
mels's user avatar
  • 343
6 votes
1 answer
164 views

How do I calculate confidence intervals for a spline function after changing the reference? I would like to plot the spline with reference at age=52 along with the confidence limits. ...
Pam G's user avatar
  • 95
6 votes
3 answers
178 views

I’m modeling mortality using a multivariate logistic regression model with a nonlinear effect of X1 and I’m examining whether this relationship changes across ...
Konstantinos Gkirgkiris's user avatar
0 votes
0 answers
35 views

I'm running an experiment where subjects need to determine if a test-image is identical or different from their (memorized) target-image. The images are divided between categories (e.g. ...
Jon Nir's user avatar
  • 131
5 votes
0 answers
106 views

I delved a bit deeper lately into GAMs and I have the feeling, the more I go into detail the more questions are popping up (well, as usual, I'd say). I recognized here and there, that there are plenty ...
1 vote
1 answer
76 views

I've got a dataset describing the infestation of an insect on plants in a very large area. The data were collected using several transects. Each transect is composed of 4 plots, with multiple plants ...
JTurra's user avatar
  • 11
4 votes
4 answers
331 views

I’m working on a logistic regression model where I want to examine whether the effect of one continuous predictor (X1) on a binary outcome depends on another ...
Konstantinos Gkirgkiris's user avatar
2 votes
2 answers
123 views

I am trying to observe the Nickell bias (https://www.jstor.org/stable/1911408) in simulation. For example, its said that using a lagged response as a predictor in a regression model can create a bias. ...
raskumaruser23877763's user avatar
2 votes
0 answers
25 views

It might be a bold question, but I wanted to be sure that I am on the right track with my thoughts, since I am no mathematician or something close :) When using GAMs with a smooth-factor interaction, ...
Maki's user avatar
  • 63
0 votes
0 answers
29 views

We run latent transition analysis with covariates using LMest and with the help of the available Literature (e.g., Bartolucci et al., 2017) and what we found on the web, we were also able to interpret ...
nviesel's user avatar
1 vote
0 answers
38 views

I have a full factorial experiment with 4 treatments: ambient (control), drought, warmed, and warmed & drought. I sampled these treatments 4 times: pre-drought, peak drought, post drought, and ...
Moriah's user avatar
  • 83
1 vote
0 answers
34 views

I have a nice multiclass random forest model in R (using the packages ranger and caret) but I think this question applies to any random forest logic. When I use my RF to label unknown data I want to ...
Dr Egg's user avatar
  • 11
2 votes
0 answers
64 views

I’m fitting a binary logistic regression model that includes a continuous variable modeled using natural splines, and I’ve also included an interaction between that spline variable and another ...
Konstantinos Gkirgkiris's user avatar
5 votes
1 answer
222 views

I’m trying to understand how natural cubic splines (splines::ns) and restricted cubic splines (rms::rcs) handle knots — ...
Konstantinos Gkirgkiris's user avatar
1 vote
0 answers
28 views

I have a mixed model that includes three different variables: Treatment, Stimulation, and DRG, as well as a random effect with DRG nested under a group ((1|Group/DRG)). I am looking to assess how each ...
Emily Tran's user avatar
1 vote
0 answers
41 views

This question is related to an earlier post. I have been trying to create a binary variable with ICC in a multilevel context. In R there is the ...
Linus's user avatar
  • 399
0 votes
0 answers
31 views

I am estimating a multinomial logit model using R’s mlogit package based on scanner data (store-level purchases). For each product category, I estimate a choice model conditional on purchase: each ...
Gast12345's user avatar
7 votes
1 answer
264 views

I've written a small simulation below to try and understand the differences in performance between fixed and random effects in a model. I am imagining a bunch of eggs incubated together in a clutch (i....
TurtleMan's user avatar
0 votes
0 answers
19 views

I'm trying to estimate a cumulative logit model with partial proportional odds while taking into account sampling weights (to make the sample representative of the population). My best option seems to ...
caterina conigliani's user avatar
2 votes
1 answer
106 views

I'm getting back into mixed effects models and have forgotten a lot. I know this is a doable test for linear regression but have forgotten if there is an equivalent for logistic regression. If I have ...
jax's user avatar
  • 41
2 votes
1 answer
190 views

I am currently working on a data-generating function in R that creates multilevel data, where I want to control the intraclass correlation coefficients (ICCs) for both the outcome and predictors. ...
Linus's user avatar
  • 399
2 votes
2 answers
101 views

I can't seem to wrap my head around this: What is the glm() equivalent for lm(log(y) ~ x1 + x2, data=data)? Is it? a. ...
Mubita 's user avatar
  • 121