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
0 votes
0 answers
9 views

Checking if the relationship between a composite score and its components across variates covariates

I have created a continuous composite score, C, which consists of scores A + B. I have a predictor variable, D. This would produce 3 different regression formulas, where predictor D has a coefficient ...
Ronald Sanchez's user avatar
6 votes
1 answer
336 views

How should I analyse TV episode popularity while accounting for time?

I have a toy dataset which contains TV episodes, the date they were released and how many streams they have received: episode date streams The Shadow Realm 2024-03-08 5987 The Forbidden Tome 2024-...
Jay Bee's user avatar
  • 161
1 vote
1 answer
25 views

Issue with bootstrap confidence and prediction intervals of mixed effects model predictions

Recently I have asked a question on how to generate meaningful bootstrap confidence and prediction intervals for mixed effect models predictions in R using bootMer ...
Marco's user avatar
  • 31
0 votes
1 answer
30 views

Estimate Weibull Shape and Scale function from lifetable data in R

I am trying to calculate a Weibull function departing from an actuarial life table using R. I have tried to transform life table data into individual patient data and then fit a Weibull using flexsurv ...
r1000's user avatar
  • 11
0 votes
0 answers
13 views

Convert any arbitrary window into a tskernel in R [closed]

Although,this question looks like a programming query, it needs a good understanding of the underlying statistics. For instance, although in my comment I have posted that I no longer see the error, I ...
user2338823's user avatar
0 votes
0 answers
25 views

log transform left data in r

I am having trouble finding the transformation operation for left/negatively skewed data. The catch? All of my values are between 0 and 1. As such, trying the standard log10 transformation command ...
YouLocalRUser's user avatar
2 votes
0 answers
28 views

Inconsistent study design

I have a study design on two sites (each site was set up in a different way) and am trying to find the best approach for the analysis. I'm looking at survival of plant species, under 4 treatments, on ...
Cristina Tarahumara's user avatar
1 vote
1 answer
9 views

non-positive-definite Hessian matrix/non-convergence problem with glmmTMB

I've got a dataset that has temperature (21c or 29c), inoculation (mock (m),single inoculations (c or r), or coinoculation (rc)), and age group (y or o). I am trying to model the interactive effects ...
user avatar
0 votes
0 answers
8 views

How to perform model comparison based on multinom( ) function of nnet package in R? [duplicate]

My independent variables are gender and sequence, and the dependent variable is intervention (including 3 intervention methods). I established a multinomial logistic regression model to examine the ...
zhang xia's user avatar
2 votes
1 answer
36 views

If measured in different time across days, should it be crossed or nested random effects?

everyone. I have a dataset that happiness was measured in morning, afternoon and evening(time of day) across 3-6 days for each subject. My two questions are: If I care about the relationship between ...
Eve's user avatar
  • 73
0 votes
0 answers
17 views

Impact of variation in the total number of samples when performing multiple fisher exact tests

I have dataset of 2 time points. In each time point I have to compare the counts of different components at each position (number of positions =1000). I used fisher exact test to compare the if there ...
Marwah Al-kaabi's user avatar
1 vote
1 answer
26 views

GLM for longitudinal or time-series -- how to model and interpret a binary logistic regression over time controlling for covariates using R

I work with the risk of delays (0 = no risk, 1 = risk). I want to run a binary logistic regression considering panel data over time. I have data from 4 years (4 time-points) and some covariates (...
Luis's user avatar
  • 153
0 votes
0 answers
21 views

How do I correctly specify nesting in the sommer R package? [closed]

I am accustomed to lme4 where it would be simply: (1|genotype/root_ID) but it's unclear to me looking through the documentation the appropriate way to do this in sommer. mod1 <- mmer(Y ~ 1, random= ...
bigoof99's user avatar
0 votes
0 answers
20 views

Conducting a network meta-analysis in R - inputting dichotomous data

I am looking to conduct a meta-analysis in R using {netmeta}. However, my outcome of interest is a little bit complex and would appreciate advice in how best to enter it into the dataset. I am looking ...
emmz's user avatar
  • 1
0 votes
0 answers
6 views

Repeated measures study design with patient drop out for blood concentrations

I am investigating the longitudinal response (course of blood concentration) to a drug in 100 patients. This is a retrospective study. For this purpose, I have blood concentrations over several ...
newbieTOggplot2's user avatar
2 votes
0 answers
16 views

In MVGAM, how can I model an interaction between 1 continuous variable (Abundance), 1 discrete (time in days) and 1 factor (the Genus of eukaryotes) [closed]

I'm working in microbial ecology and I'm trying to modelize the influence of the abundance of several genuses on a single genus of interest through time in a situation of primary succession of ...
Samuel beauregard-tousignant's user avatar
0 votes
0 answers
17 views

Cook's d for multi level model in R [closed]

Is it possible to use Cook's distance for outlier diagnostics in R for a multi-level model? If so, for which of the models would I apply it when calculating several and inserting stepwise predictors? ...
Willy's user avatar
  • 53
0 votes
0 answers
22 views

R error: 'Response is Constant' - GAMM [closed]

I am trying to create a species distribution model for penguins assessing the influence of different environmental variables on their distribution. Originally I planned to fit a GLM but after further ...
user419500's user avatar
0 votes
0 answers
28 views

Effect-Size Analysis: Cohen's D, Pearson's r, or something else?

I am trying to do an effect-size analysis on dam release's effects on downstream temperature. I have a large dataset of data loggers taking temperature readings at various sites downstream from the ...
Matt Schaaf's user avatar
0 votes
0 answers
12 views

GLS on geometric mean ratio from biological data

My data are biological data in which I have 10 proteins that I have measured their concentrations in different (N=8) samples from (N=42) participants. All these samples were taken from the same ...
N10's user avatar
  • 1
2 votes
2 answers
66 views

Issue fitting and plotting GAM with soap film smoother

I am having an issue fitting a gam with mgcv in R and am looking for some help. In brief, I have a dataset that contains numbers of fish from one of two groups (Hatchery or Wild) that were detected at ...
Jack B's user avatar
  • 21
0 votes
0 answers
13 views

Conditional_effects() plots from brms model has a response category with consistent 0 probability (flat plot) [closed]

I have a multinomial logistic regression model using brm() with the response variable is six different species. The model converges and the summary output (see ...
LeoJha's user avatar
  • 1
0 votes
0 answers
15 views

Conditional Logistic (Discrete Cox PH) Regression Model

I am very new on the topic of disc påret time survival modeling. I found the following function in R from package powerSurvEpi. It seems that powerConLogistic.bin function can be used for #Sample Size ...
elisa's user avatar
  • 33
1 vote
1 answer
81 views

Analyzing review rating using R STM package - sample balance issue [duplicate]

For the online reviews datasets, one of the tasks is to investigate the difference in topic proportion (e.g., topics as positively vs. negatively commented). Because of the positively skewed J-shaped ...
James's user avatar
  • 33
3 votes
1 answer
198 views

Can I include a variable related to the outcome variable into statistical analysis?

My research question is about the contact patterns during the pandemic and what characteristics of people who contacted more person during the national lock down. The outcome variable is a variable ...
Chao's user avatar
  • 33
0 votes
0 answers
27 views

Sampling distribution of the proportion of events

For categorical variables with $l \ge 2$ categories, what is the sampling distribution of the proportion of events in each category? These are obviously not independent, since they add up to 1. Does ...
Jessica's user avatar
  • 1,251
1 vote
1 answer
62 views

Date as random effect in mixed model strongly changes coefficient estimates

I am struggling with the structure of a mixed model that I run with lme4. I have measured a behaviour (let's say reaction time) and another variable that might impact it (let's call it "mood, ...
BRB's user avatar
  • 33
1 vote
1 answer
21 views

AR(p) model in R not fitting data [closed]

I have a set of data that I am trying to model with a simple AR(p) model. I've run a Dickey Fuller test on unit root stationarity and reject the null. However, when I run a simple ar command in R I ...
hmmmm's user avatar
  • 529
0 votes
0 answers
41 views

Steps to conduct a linear mixed model and post-hoc comparison test

I would like to ask for your help with the best way to analyze the following experiment within R. Here is my design: there are 15 treatments, in four blocks. For each treatment, in each block, we have ...
Caio Mattos Pereira's user avatar
1 vote
0 answers
28 views

Degrees of Freedom in Emmeans

I am using the 'emmeans' package in R to compute estimated marginal means for my (liner mixed-effects) model. However, I am enountering a warning message related to the number of observations ...
babygould's user avatar
1 vote
0 answers
31 views

Looped Regression and Inference in Stata or R

I have a sample of panel data and am running regressions on a loop for values of a specific categorical variable. For illustration: $$ y_{it} = \alpha_i + \eta_t + \beta^C D_{it} + \epsilon_{it} $$ ...
Darken Economics's user avatar
0 votes
0 answers
11 views

Test cases for cmprsk [closed]

It has been years since I used cmprsk or programmed in R. I am interested in optimizing the backend Fortran libraries for this package but want to be 100% sure I ...
drjrm3's user avatar
  • 203
3 votes
1 answer
37 views

How to analyze this data in R, where there is no clear distinction of the response variable and the predictor variable? [closed]

Is there a statistician out there who knows how to analyze psychology surveys? Due to the way my response variable is structured in my data frame, I'm struggling to analyze it in R. Please, I ...
user avatar
0 votes
0 answers
24 views

Quantifying effect-size and correlation between two data frames

I am conducting an effect-size analysis on dam release and downstream temperature measurments. To do this, I am comparing the gauge temperature (the temperature of the water released from the dam) ...
Matt Schaaf's user avatar
0 votes
0 answers
14 views

Is this the correct way to go about determining correlation between upstream and downstream temperature?

I am new to stats and r in general, so please bear with me. I have been trying to find an answer to this question for about the past week and have spent a ton of hours researching but am still ...
Matt Schaaf's user avatar
4 votes
3 answers
101 views

How to fit a Bayesian model to a mixture of Beta and One-Zero inflated data?

I have very noisy data, which I believe is created through interactions of multiple physical processes. In the mapping $Y = f(X),$ $Y$ is a ratio $[0, 1]$ and $X \ge 0.$ While $Y$ is a function of $X,$...
PPR's user avatar
  • 101
0 votes
0 answers
29 views

How can i make a simple visualization of my result from a two way fixed effects regression model?

I am trying to understand the effect of the variable x1 on the dependent variable y1, and for that i have panel data. I decided to use a two way fixed effects model to estimate the effect of variable ...
user413005's user avatar
-1 votes
0 answers
12 views

R ggplot: Using geom_text or geom_label inside geom_bar [closed]

I am plotting the publication of scientific papers on a specific research topic on a timeline. I would like to add author and year to the corresponding rectangles using the "label" variable. ...
Milena's user avatar
  • 29
2 votes
1 answer
73 views

What are the `estimates` returned by `avg_slopes()` in modelsummary?

I have an interpretation question of R's marginaleffects avg_slopes function for logistic regression models. Consider the ...
spindoctor's user avatar
0 votes
0 answers
22 views

Linear mixed model, negative information criteria values and Hessian matrix not positive definite?

I'm trying to perform this operation in R. ...
Maley's user avatar
  • 1
0 votes
0 answers
9 views

Repeated-Measurements Analysis with Cross Correlation

I am trying to find the cause-and-effect relationship between water release from dams and downstream temperature. I have a data frame containing all of the temperature measurements from various sites ...
Matt Schaaf's user avatar
0 votes
0 answers
38 views

Selecting degrees of freedom in stepwise regression (stepAIC function in R)

Context: I have data available on water quality in a number of catchments, for example the concentration of Zinc (Zn). For each catchment, I also have a range of characteristics (n=16), such as the ...
Matt Tomkins's user avatar
1 vote
1 answer
48 views

Correlation alternatives / How to go about testing this relationship?

I have a large set of temperature data from upstream and downstream gauges. I am trying to find the influence of dam release on downstream temperatures. To do this, I am comparing correlation between ...
Matt Schaaf's user avatar
0 votes
0 answers
26 views

Correlation alternatives / How to go about testing this relationship?

I have a large set of temperature data from upstream and downstream gauges. I am trying to find the influence of dam release on downstream temperatures. To do this, I am comparing correlation between ...
Matt Schaaf's user avatar
2 votes
1 answer
41 views

Key driver analysis in R - different packages produce slightly different results: Is this to be expected?

I am doing a key driver analysis with customer experience data. I have run the analysis with three different packages in R: rwa, ...
user13716's user avatar
  • 123
0 votes
0 answers
14 views

Tradeoff between autocorrelation and memory in a GLMM

I am working with a large dataframe in R. It is a BACI design (Before-After-Control-Impact). I am interested in seeing if the interaction between Treatment (0 = control, 1 = impact) and Period (Before,...
Elise Miller's user avatar
0 votes
0 answers
26 views

Determining the p-value of a test statistic, which is not distributed according to a commonly known distribution under the null hypothesis

Currently I am working in R on a project that aims to identify Dragon King events (massive outliers) in large datasets. These outliers appear for example in the city sizes in England, where London is ...
user25936873's user avatar
1 vote
0 answers
26 views

How to simulate this AR(1): Xt =2+0.8(Xt_1 −2)+εt series in R? [duplicate]

I want to simulate an AR(1) model defined as follows: $$X_t = 2 + 0.8(X_{t-1} −2) + \varepsilon t$$ but I do not know how to interpret the constant $2$ in this term. How do I simulate this in R?
Maurice Pape's user avatar
1 vote
0 answers
16 views

Grid-level spatial fixed effects (with time and seasonality)

I have panel data with reported human-wildlife conflicts with a date and grid cell location: I'm trying to isolate the impact that extreme precipitation and temperature have on conflict rates. I am ...
spes's user avatar
  • 11
3 votes
1 answer
109 views

Why would `pROC::roc` calculate $\max\{AUC, 1 - AUC\}$ by default?

There is some interesting behavior in the pROC::roc function in R. ...
Dave's user avatar
  • 64.7k

1
2 3 4 5
601