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`.
30,436 questions
0
votes
0
answers
9
views
Why is the ones trick making my hurdle model crash in jags?
I'm running a hurdle model in JAGS but if randomly crashes for reasons I cannot determine. The model describes the presence absence of a species and, when the species is present, its biomass. It uses ...
0
votes
0
answers
40
views
How to estimate the impact of a continuous variable x on a continuous dependent variable y by group of increasing range of y?
From a database of about 40,000 rows, I would like to test whether the concentration of a drug x0 has an impact on the concentration of a plasma biomarker ...
2
votes
1
answer
55
views
R Cox.zph vs Stata estat phtest
Looking at the GBSG2 dataset from TH.data package I did a Cox model in Stata and R on the same covariables and tested for proportional hazards using cox.zph in R and estat phtest in Stata. As far as I ...
0
votes
0
answers
17
views
Fine & Gray fails due to singularity - but Cox and binomial regression do not
I'm currently performing an analysis with various survival models. I have relatively many binary covariates (up to 8) with a relatively low number of events (~80).
Using the Fine & Gray competing ...
0
votes
0
answers
27
views
Why the one-sided p-value is so much smaller than two-sided for K-S test? [closed]
I am using r function ks.test(x,y) to perform a K-S test on 2 sets of data (significance of difference between distributions).
When calculating the two-sided p-...
2
votes
0
answers
56
views
Logistic model giving mixed results
I am currently creating two logistic regression models (one with forward selection and one with LASSO) using R to predict whether a patient has a malignant or benign breast cancer from this dataset: ...
0
votes
0
answers
12
views
Problem with fractional cointegration test result interpretation
I'm struggling to interpret result of cointegration test (fractional case (Johansen and Nielsen, 2012)).
This test suggest that in two non-stationary series could be a cointegration but in fractional ...
1
vote
1
answer
37
views
Helmert contrasts in lm() or emmeans()
For context, I used to set contrasts in my model by assigning them to my variable as a matrix using contrasts().
For example, for a factor with four levels and a ...
3
votes
1
answer
40
views
Writing lme mixed model as equation: equatiomatic vs LearnVizLMM - which one is right?
Suppose we have:
library(lme4)
data("sleepstudy")
model = lmer(Reaction ~ Days + (Days|Subject), data = sleepstudy)
Now we extract the equation with ...
0
votes
0
answers
20
views
Plotting Boxplots with measured variable on the X-axis [closed]
I have data set on underground water mineral content measured along a river basin at three locations: Upper, Middle and Lower. The measured values are Hydrocarbonate, Chloride, Sulphate content and EC....
0
votes
0
answers
34
views
Specifying a correct correlation structure in a hierarchical linear model using nlme's "correlation"-argument
I am modelling longitudinal data, using hierarchical linear modeling (HLM). There are 6 measurement points. We assume that the data between these measurement points is correlated. To account for such ...
4
votes
1
answer
29
views
Sample size calculation Split Plot design
I'm currently trying to calculate the sample size for a completely randomized split-plot design. The design includes two treatments at the whole-plot level and two treatments at the sub-plot level. ...
0
votes
1
answer
25
views
Handling recurring convergence issues in multiple change point detection in R
I'm trying to run a series of multiple change point models on a large number of time series variables, but I am running into occasional convergence issues that I would like advice on how to handle. I ...
2
votes
0
answers
37
views
Calibration with all data: data-poor scenarios
I’m working on species distribution modeling with binary data (presence��/ absence, 1 / 0). My target species is extremely rare (prevalence ~0.014), so my dataset is almost all zeros and just a handful ...
1
vote
0
answers
26
views
How to estimate Realtive Risk in GLM models with interaction term?
I want to assess if high levels of an A variable affect the impact of temperature on hospital admissions. I used a dlnm models combined with glm to estimate RR:
...