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
20 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....
talikarng's user avatar
2 votes
0 answers
14 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
23 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
12 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
29 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
11 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
6 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
9 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
37 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
22 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
34 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
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
0 votes
1 answer
10 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
4 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
0 answers
14 views

Simulating correlated reaction times and accuracies in R [closed]

I am trying to simulate reaction times and accuracies with a certain correlation. This is my first guess: ...
Michele Scandola's user avatar
0 votes
1 answer
43 views
+50

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
30 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
73 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
80 views
+50

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
  • 559
0 votes
2 answers
37 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
59 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 vote
0 answers
36 views

Two-Way Fixed Effects Model in R - Error - Multicollinearity

I am trying to build a two way fixed effects model (entity-specific and time-specific fixed effects). However, when I run the fixed effects code in R, I get the following error message: ...
carol's user avatar
  • 11
-1 votes
0 answers
14 views

I can't install glmulti package in R version 4.3.1 on Ubuntu 22.04 [closed]

I am trying to install glmulti package in R and I have RJava installed. Then it stopped at testing if installed package can be loaded from temporary location. Here ...
Ola's user avatar
  • 1
1 vote
1 answer
26 views

Is this GLM approach appropriate for binary data and determining difference between 8 groups?

I have been given a dataset to analyze looking at some herbicide treatments for invasive trees in three states with 3 sites in state 1, 2 sites in state 2, and 1 site in state 3. We hope to answer ...
E10's user avatar
  • 71
0 votes
0 answers
17 views

Is it possible to specify correlation structure for mixed models in Julia? [closed]

Is there an equivalent approach to the following mixed model, growth curve analysis in Julia: ...
SanMelkote's user avatar
0 votes
0 answers
10 views

MCMCglmm package [closed]

the summary() for my ordinal model isn't returning all of my cutpoints. There are four levels in my response variable but I'm only getting two cut points. Does anyone know why?
smithx's user avatar
  • 1
0 votes
0 answers
11 views

Cant graph a PCA plot in R error code "The variable X is not quantitative" [closed]

I am trying to plot a PCA. I have run the following code in R res.pca = PCA(df, scale.unit=TRUE, ncp=5, graph=FALSE, quali.sup= 1) plot.PCA(res.pca, axes=c(1,2), habillage = 1, choix = "ind",...
carl adam's user avatar
0 votes
0 answers
24 views

How to handle zeros before carrying out CLR transformation to deal with compositionality before Spearman correlation?

My data is very zero inflated - even when carrying out previous filtering, such as getting rid of data that has very low counts and have values in more than 60% of samples. However, the 0 values still ...
aim6789's user avatar
  • 53
0 votes
0 answers
12 views

Is this glm approach in r appropriate for determining differences (if any) between 8 groups with binary data?

I have been given a dataset to analyze looking at some herbicide treatments for invasive trees in three states with 3 sites in state 1, 2 sites in state 2, and 1 site in state 3. We hope to answer ...
E10's user avatar
  • 71
0 votes
0 answers
21 views

gamm4 output size is too large (~5GB). How to decrease? [closed]

I am running a Generalized Additive Mixed Model with the R package, gamm4. Each model output includes a mer object and a gam object. I need to compare 26 model structures based on a combination of ...
megsruppUNBC's user avatar
0 votes
2 answers
64 views

Apply Monte Carlo simulation to historical data to determine probability of event to happen

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
1 vote
0 answers
14 views

How to account for time in linear mixed effects model?

I have data collected over a year in months Oct2021, Dec2021, Jan2022, April2022, July2022, Aug2022, Oct2022. Ultimately, I would like to understand how my response variable varies across time. I ...
aim6789's user avatar
  • 53
-1 votes
1 answer
36 views

difference between c-statistics and AUC for prediction performance

I have two types of outcome from a big dataset and I performed prediction models and checked the prediction performance using 10-fold cross-validation, so: for binary outcome: lasso logistic ...
user358238's user avatar
1 vote
0 answers
63 views

Is there any algorithmic-pseudocode/Python-implementation for the DAG-related API(s) in the R package dagitty? [closed]

The statistical software DAGgity offers a graphical web-based UI as well as an implementation in R that allows for finding conditional independences corresponding to d-separation, minimal adjustment ...
Anirban Chakraborty's user avatar
1 vote
0 answers
11 views

Is there a justification for the Bernoulli deviance in the R stats package?

Using the standard glm(...) function in R for Bernoulli regression, it appears that the residual deviance has the same value as the binomial deviance where each ...
Straine's user avatar
  • 11
0 votes
0 answers
5 views

How to compare fluctuation/standard deviation across several datasets?

I have a set of humidity and temperature readings for several different locations on the same site. I am trying to determine whether these readings are fluctuating more in certain areas. I've got the ...
clarkey000's user avatar
0 votes
0 answers
31 views

Plotting the effects of an interaction term in a FE model

for my bachelor thesis i have the following linear regression model with fixed effects that i use to predict the effects of economic sanctions on GDP: ...
slicey's user avatar
  • 31
0 votes
1 answer
17 views

How can I stack rank 100 items based on head-to-head comparisons?

In an upcoming release of my game I'm planning to add a hundred discrete items players can unlock. I'd like to assign each of these items a sell price and a rarity tier - I obviously have my own ...
penitent_tangent's user avatar

1
2 3 4 5
586