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
5 views

Geom_smooth of predicted count warnings [closed]

I am currently writing an update of an article on vulture population trends (Vulture article) and looking at regular feeding at four long-term vulture restaurant sites from July 2016 to December 2023. ...
Emeline AUDA's user avatar
0 votes
0 answers
10 views

Lavaan Estimator

I did a three-wave study with repeated measured for each wave.I have two questions: I am doing a CFA for a configural model (testing temporal invariance for each variable of my model at 3 points in ...
Madisca's user avatar
0 votes
1 answer
29 views

lmer - how to report results and group differences? [closed]

I want to test the effect of my treatment drug on different populations. I have 3 groups, tested at 3 time points, and one dependent variable. My data: ...
CAA's user avatar
  • 1
0 votes
0 answers
12 views

Computing p-value using bootstrap bias-corrected and accelerated (BCa) confidence intervals - R

The boot.pval package throws an error when computing BCa p values. This suggested fix seems to work but I am unsure if this correct. The fix was suggested more than two years ago without having being ...
edo's user avatar
  • 23
0 votes
1 answer
17 views

Which kind of matching can i use and why doesnt my propensity score matching work?

I am currently trying to find out if a certain disease characteristic affects long term survival. I have observational data and i am trying to match my cohort, as there are huge baseline differences ...
Joseph Kletzer's user avatar
0 votes
0 answers
17 views

Optimal sequence analyses and hypothesis testing

I am working with data in R using the TraMineR package. I am fairly new to this type of analysis, so please bear with me. I have a list of unique events (Ex: A-F) that occurred within a dyad over time....
user17451520's user avatar
1 vote
0 answers
13 views

Sample Size: Cluster Randomized Trials

I seek a peer check on my approach in calculating the sample size for pair-matched or stratified cluster randomized trials assuming 80% power. Some background on the study: I am working with ...
Tavaro Evanis's user avatar
1 vote
1 answer
30 views

My data is clustered in space, how can I account for that in a GAMM?

I am modelling whether a bird nest is build or not based on the date it was built, the geographical coordinates where the nest was built, and using the year when the nest was built as random effect - ...
Teresa's user avatar
  • 21
0 votes
0 answers
13 views

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 if there is a ...
Marwah Al-kaabi's user avatar
0 votes
2 answers
57 views

What are the possible solutions for performing full matching on a dataset with a size of 61,000? [closed]

I am working with a dataset of approximately 61,000 observations (with 27,686 treatment and 32,405 controls) and need to perform full matching using the MatchIt ...
eshuns's user avatar
  • 3
0 votes
1 answer
20 views

Use SMD or raw difference in proportions when comparing balance of binary covariates used in propensity matching?

I am a junior in the medical field, and have been tasked with performing a propensity matched analysis of some data, using R. I am looking at comparing the balance of my covariates (both before and ...
sunny_aus's user avatar
0 votes
0 answers
18 views

Issues with Detecting Negative Change in AR(1) Model Using CPAT Library

I'm currently working on evaluating the empirical power of the CUSUM, Rényi CUSUM, and Erdős-Darling tests for detecting change points in AR(1) models, specifically focusing on changes in the mean. ...
Aouissaoui's user avatar
0 votes
0 answers
10 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
8 votes
1 answer
589 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
  • 185
1 vote
0 answers
34 views

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

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
  • 33
0 votes
1 answer
31 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
15 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
30 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
29 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
14 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
9 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
20 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
2 votes
1 answer
28 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
  • 163
0 votes
0 answers
22 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
1 vote
1 answer
25 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
  • 11
0 votes
0 answers
8 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
17 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
23 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
29 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
2 votes
2 answers
74 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
16 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
85 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
215 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
  • 73
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
63 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
43 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
29 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
3 votes
1 answer
38 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
105 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
2 votes
1 answer
75 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

1
2 3 4 5
601