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

Latent growth curve model: should you include predictors if the variance for slope and/or intercept factor is not significant?

Hi I am running a series of latent growth curve models. I am wondering: can predictors of the slope and intercept factor(s) be included when the slope and/or intercept variance are not significant, or ...
Aepkr's user avatar
  • 115
0 votes
0 answers
21 views

zero inflation and endogeneity in logit or probit model

What is the good model for the case of bias in the distribution of the dependent variable? The dependent variable is categorical variable and one categories are dominant (about 90%). Although I can ...
Sho's user avatar
  • 1
0 votes
0 answers
13 views

When to use factor and ordinal factor?

When modeling a regression (glm.nb) one of my predictors is the number of sides of a road that has forest next to the road. This means my predictor can take one of three values. 0 = no forest on ...
Adina's user avatar
  • 1
0 votes
0 answers
19 views

How to introduce random effects to a GAMLSS model?

I am quite a novice in both R and GAMLSS fitting and could use some help introducing random effects to a GAMLSS model. I want to model the relationship between a variable and subject age. My ...
Thijs's user avatar
  • 1
0 votes
1 answer
20 views

Do I need to use a factor for the ANOVA?

The problem: A psychologist is interested in short-term working memory under (1) sleep deprivation, (2) a strong dose of caffeine, (3) following 8 hours sleep. They conduct a between subjects design. ...
Cathrine's user avatar
0 votes
0 answers
6 views

Sensitivity Analysis selection for nested data?

So the data I'm working with is GPS tracking data of pelicans and Offshore rigs with the goal of seeing if pelicans are positively or negatively affected to the presence of rigs. But before I can do ...
Jackson Grady's user avatar
0 votes
0 answers
19 views

Interpreting HR when using tt() function

Assuming non-proportional hazards for karno (and based off p 21): https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf How does one interpret the HR for karno? Is the HR = 0.9590 for ...
LucaS's user avatar
  • 515
0 votes
0 answers
12 views

Generate series with multiple seasonality

I have to simulate time series with multiple seasonality and I don't understand how I can do it. In particular I have to simulate: A series with two deterministic seasonality (each with a different ...
Diego's user avatar
  • 1
0 votes
1 answer
8 views

How do I interpret a cox proportional hazard model?

I fitted a cox proportional hazards model in R using the coxph(). My explanatory variables include; gender, residence, antenatal care, tetanus injection, iron tablets, size at birth, place of delivery ...
user avatar
0 votes
1 answer
19 views

Why do some rows in gtsummary output show OR=1 and CI containing 1 but have significant p-values?

0 I am using gtsummary to create a table that merges univariate and multivariate regression results. Here's the code I'm using: ...
Dite Bayu's user avatar
0 votes
1 answer
56 views

whether to adjust or not adjust for baseline in longitudinal RCT

I have a longitudinal RCT data, aiming to compare the superiority of one group with high exercising to the other group with low exercising to see the improving of pain (pain is outcome). Data is ...
user358238's user avatar
1 vote
1 answer
40 views

What kind of logrank test is performed by survdiff function in R?

Information added: this question is not duplicate, neither my question nor the question in the link had been solved at all, I added more info to see if you can see the problem I was trying to ...
Estrella's user avatar
0 votes
0 answers
11 views

repeated measures with glmer [closed]

I have used glmer before but not for a psychology experiment. So I want to double check if the way I'm using it is correct. My current design is that for each subject, there are two conditions. For ...
Haimei Yu's user avatar
1 vote
1 answer
58 views

Appropriate test for comparing categories in two groups?

I have a subset of a data as below: I would like to compare two groups (1/0) for 6 categories for using a medication Every week they could choose more than one option for each question. The number of ...
user358238's user avatar
0 votes
0 answers
16 views

How to obtain the KEGG mudule based on KEGG KO? (KEGG mudule enrichment) [closed]

With HUMAnN3, I got the result of the KEGG KO annotation (by humann_regroup_table). What do I need to do if I want to get the KEGG module annotation result? I did not find the relevant guidance/...
Xin Xu's user avatar
  • 31
1 vote
1 answer
27 views

Is it statistically sound to use r mice to predict values instead of classic lm

I have access to a population of around 5 million people. I also have access to multiple social and demographic variables (age, gender, level of education...). I randomly sampled 10,000 people from ...
Charly Marie's user avatar
0 votes
0 answers
18 views

How do I move forward to find a better model fit, help interpreting DHARMa residuals

I am trying to test if there is an effect on number of individuals depending on the proportion of a certain land use type and its management. But I don't find a model with a good fit. There seems to ...
Vevey's user avatar
  • 1
0 votes
0 answers
22 views

Sampling based on two variables [closed]

I am using R to draw a sample of 111 cases from a database of 188 cases. I have a variable for age groups (there are three age groups) and a variable for geographical region (25 regions). Example: <...
Elaaryia's user avatar
0 votes
0 answers
22 views

Change the values being operated on in lapply to create a matrix from a list [migrated]

I am running the following code in r to transform correlations I have extracted in wide format (dat7) into a list of correlation matrices. (The code is my attempt to reimplement http://www.suzannejak....
brendans-bits's user avatar
2 votes
0 answers
17 views

Identify the distribution of data [closed]

I did one experiment two times with the same subject. I want to find the repeatability of my result. repeatability in a sense is the fraction of behavioural variation that is due to differences ...
VINITHA M S's user avatar
1 vote
1 answer
28 views

Help laying out and interpreting multiple regression

Let's say I want to model children's reading scores as a function of family income, type of school (K-6 or K-8), and an interaction. Therefore my model is \begin{align} Y = \beta_0 + \beta_1 X_1 + \...
Francesco Squillari's user avatar
0 votes
0 answers
16 views

semPower: Accounting for Clustered Standard Errors in SEM Power Analysis with Fixed Effects Model

I am planning to analyse clustered data with a structural equation model and as I am planning on submitting my project as a registered report, I am first trying to do an in-depth power analysis (it is ...
Maximilian's user avatar
1 vote
1 answer
33 views

Latent growth curve model: The variance-covariance matrix of the estimated parameters (vcov) does not appear to be positive definite

I have run a latent growth curve model in R using lavaan and got the below warning. It would be good to hear suggestions on how to resolve this warning. The full output is below. Note that I dummy-...
Aepkr's user avatar
  • 115
0 votes
0 answers
13 views

incongruences between F-stats in the R cancor package

I'm using the R package candisc to perform canonical correlations. Since my dataset has missing values (only 36 rows without any NAs out of 88 rows total), I have two options: I can use the raw ...
larmor's user avatar
  • 33
0 votes
0 answers
7 views

Post-hoc sub-ANOVAS on ezANOVA - how to correct for multiple tests

Using a dataframe which looks like this (with 3 raws per "id"): ...
user397068's user avatar
0 votes
0 answers
10 views

modeltuner hyperparameter tunining [closed]

suppose I have a multimodel produced using modeltuner approach with nrounds = 5000 with differet values for alpha alpha = c(0, 0.001, 0.01, 0.1, 1, 10, 30). I have done cross validation on the model. ...
Aswathy's user avatar
0 votes
0 answers
41 views

How to aggregate survival type of data to single measure independent of time?

Thank you for the opportunity to ask this question. Since I do not speak fluently (still learning) the language of mathematics, I explain this in plain English. I understand this is too ideal but I ...
Maximilian's user avatar
1 vote
0 answers
26 views

Prediction based on new data in the tsDyn package [closed]

I decided to use the tsDyn package to build the model and precision the values. The argument for this package (I previously worked with urca, vars) was the ability to make predictions based on new ...
GrBa's user avatar
  • 111
0 votes
0 answers
10 views

Clustering of Variables around Latent Variables (CLV) over only qualitative data

I'm reaching out today because I have a concern regarding the clustering approach employed with the CLV method introduced by Vigneau and Qannari in 2003. I've noticed that this method is predominantly ...
lasagna's user avatar
  • 11
3 votes
1 answer
37 views

Why does nlme::fdHess return NaNs when evaluated at 0? [closed]

Why does the finite-differences gradient/hessian approximation nlme::fdHess return NaNs when seeking the gradient/hessian at 0? <...
kara890's user avatar
  • 129
0 votes
0 answers
23 views

R deltaMethod(): evaluating a combination of parameters when one cell is empty [closed]

I'm running a linear regression with two categorical predictors and their interaction. One combination of levels does not occur in the data, and as expected, no parameter is estimated for it. I now ...
octern's user avatar
  • 564
1 vote
1 answer
36 views

How to specify a linear mixed model (LMM) for a repeated measures design with two categorical predictors and one continuous?

I would appreciate some help figuring whether a linear mixed model (LMM) is a good choice for my data. My experiment is a 3 (neurostimulation target) X 2 (task block) repeated measures design that ...
arhopki's user avatar
  • 11
0 votes
1 answer
17 views

Best test for comparison of temporal counts

I have a data set of 182 concurrent count observations using two different methods and I was wondering what would be the best test to evaluate how closely related they are to each other. My data set ...
Ryan Gary's user avatar
-1 votes
0 answers
20 views

Wrong results for (pseudo)median on Wilcoxon paired test in R [closed]

I calculated results for the paired Wilcoxon test, one of which is (pseudo)median. I tried to reproduce the computation of the ...
sbac's user avatar
  • 143
0 votes
0 answers
15 views

Is there a general way to detect a linear combination? [closed]

I'm new using Rstudio and trying to solve linear algebra exercises made by hand into R-code, but I'm struggling a little bit. By theory, to detect if there's a linear combination between vector, you ...
user avatar
0 votes
0 answers
6 views

Use a sequence of bernouli trials to find the possibility of an event happening

I have the data below and We have a game, that has a prize jackpot. The jackpot prize starts at 1,000 credits and every round you play the jackpot increases, until someone wins the jackpot and it ...
firmo23's user avatar
  • 137
0 votes
1 answer
18 views

Differences in Regression model for Dummy Coding (factor vs. recode) [closed]

I have the following problem: I generate Dummy Variables with the recode and the factor command. In my regression I got different output for the "lower middle" variable and couldn't explain ...
Marvin11's user avatar
0 votes
0 answers
11 views

Pairwise t test (holm correction) with ezANOVA output [migrated]

I'm doing data analysis using R (dyplr). I'd like to perform post-hoc comparisons using the pairwise.t.test() function in R and the output of the ANOVA I performed with ezANOVA() but I don't know how. ...
user397068's user avatar
0 votes
0 answers
7 views

How to handle recent variable change resulting in level-switch in time series modeling?

I developed a script to run time series models on people data, and I re-run the Arima model fitting/forecast reconciliation algorithm monthly as new data comes in. I use the grouped/hierarchical time ...
Gabrielle's user avatar
1 vote
1 answer
16 views

Interpreting an estimated bivariate VECM

I have used the tsDyn package in R to estimate a VEC model for the data in the graph, and I am unsure about my interpretation of the output. ...
Richard Hardy's user avatar
0 votes
0 answers
5 views

is LFC shrinkage necessary when using DESEQ differential abundance analysis for microbial abundance data?

LFC shrinkage used to be default in the DESEQ function but it was updated, because it is not always recommended to do. But i cannot find much information on which conditions this is decided. Are there ...
user avatar
0 votes
0 answers
38 views

Mixed effects model for prediction

I have a dataset where I collected cortisol samples 3 times a day, for 3 days at 2 timepoints. I am interested in looking at changes in cortisol right after awakening, at 0 min after awakening, 30 min ...
magg's user avatar
  • 13
0 votes
1 answer
55 views

Specifying a mixed effects model with repeated constructs but cross-sectional observations (crossed vs. nested data at three levels)

I have a question about specifying a mixed model with crossed data across multiple levels. Consider the following situation: Let’s say I collected data on Americans’ perceptions about the importance ...
JmQ's user avatar
  • 95
1 vote
0 answers
40 views

Cox model with ridge term: how to choose value of theta?

The coxph() function in R package "survival" is used to fit the Cox proportional hazards model. This function allows a ridge() term in the formula to penalise selected terms, which requires ...
user167591's user avatar
2 votes
1 answer
165 views

Should I use negative binomial GAM?

I'm trying to model a data of presence and absence of birds in nest boxes. I look whether it's zero-inflated and it gave me this: ...
Hari Tsivlin's user avatar
1 vote
1 answer
32 views

Understanding the significance level of a confidence interval

I generated 1000 confidence intervals with 95% significance level and I am testing H0: μ = 0 vs H1: μ != 0. What means if 97.5% of my confidence intervals have the 0 included? It should be exactly 95% ...
user396376's user avatar
0 votes
0 answers
77 views

Spatial structure in the random forest residuals

I have a data.frame which includes the response and several predictor variables. The variables were raster data which I converted them into a ...
Nikos's user avatar
  • 111
1 vote
1 answer
93 views

How to Compute Mean Ratios and Their 95% Confidence Intervals in a Bayesian Model

I am working on a Bayesian model using the brm function from the brms package in R, and I am interested in comparing mean responses of different groups. Specifically, I would like to calculate the ...
mat's user avatar
  • 561
0 votes
2 answers
38 views

Correlation among 10 binary variables

I have a dataset like this: All these social determinants are binary variable. How can I find the correlation among them? By chisq.test? Since I have 11 variables and it will be 55 pairs. Is there ...
user avatar
0 votes
1 answer
62 views

Variances explained by each feature on PC in PCA

I came across this article with an associated Python codebase. In brief, there is a section "Understanding How Features Contribute to PCs ", where... One method for understanding which ...
Rover Eye's user avatar
  • 577

1
2 3 4 5
586