# 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.

22,062 questions
Filter by
Sorted by
Tagged with
8 views

### LOOCV in Caret package ( randomForest example) - not unique results

I pose you my doubts: For what I know there is only a single way to perform a LOOCV for a model (i.e. testing each one of the N elements vs the model trained with the other N-1 elements). Namely, ...
18 views

### Statistical Model used for predicting number of deaths due to COVID-19 [closed]

What statistical model is used to predict number of deaths due to COVID-19? Suppose I have a dataset with number of deaths for last two months and would like to predict number of deaths for next month?...
7 views

### How to analyze repeated measures when condition changes at each time point?

I have a dataset from a repeated measures experiment that I am trying to analyze. The experiment had 4 possible conditions. Participants were measured on 1 condition and then again on a second ...
5 views

### cox frailty model in R

I run a cox frailty model(model 1) in R, by adding new co-variate to model(model 2) The ACI decreases that show the new model is better than model 1, but the variance of random effect of model 2 is ...
9 views

### What is the ACF plot of $x_t = 0.9 x_{t-2} + w_t$

I am just learning time series, and I am wondering about the following AR(2) model: $x_t = 0.9 x_{t-2} + w_t, w_t \sim N(0, \sigma_w^2)$ Please show me the plot of its Autocorrelation Function, or ...
5 views

### How to calculate correlation coefficient and AIC for non-linear estimation in R or Statistica?

I need to compare two non-linear models of growth. The first one is calculated with nls function in R and with non-linear estimation function in Statistica - both programs gave identical results and ...
10 views

### R: read.csv imports my numeric columns with lots of missing as NULL, how to prevent? [closed]

My data has 63 columns, and for a column, 'hours' has more than 50% of missing values and it's converted as NULL when importing. But the column is very important and needs to be used after cleaned....
19 views

### No significant p values after multiple comparison of 126 tests

I am wondering if there is any reasonable other ways to adjust for multiple comparisons when you have such a large number of tests. I have a study with 126 brain regions being scanned in a group (N=20)...
6 views

### variation partitioning with a GAMM model including an auto-correlation structure in R

I would like to undertake variation partitioning in a GAM framework in R, as described here: http://r.789695.n4.nabble.com/variance-explained-by-each-term-in-a-GAM-td836513.html However, my gam ...
17 views

### Using the STAN math library [closed]

I would like to use a Matern Covariance Function for gaussian process regression in STAN. (Through RStan) The standard exponential covariance function works withouth issues ...
7 views

### How to test Multinomial Logistic Regression assumption in R

So I'm currently trying to use a multinomial logistic regression model in R on a data set with 13 variables (mix of continuous and categorical) and 33,000 observations, where the dependent variable ...
23 views

### R: Question about central limit theorem

Hello everyone :) can you help me please, I really don't understand my teacher's videos and it is the last part of our 20-pages work :O In the question 1 they ask us to create a Poisson distribution ...
15 views

### syntax of gam longitudinal dataset

I would like to have some help on gam syntax in R, not sure if I should ask here or in stackoverflow but because I also have difficulties to understand how the model handles random effect I start here,...
26 views

27 views

### I want to compare a forecast with actual inventory, what statistical tests can I use?

I have two datasets, both are .csv files: Forecast- Marketing team's forecast of inventory levels that would be required in 2019 Inventory - Factory's records of actual inventory values recorded in ...
7 views

### Use a Bayesian approach to construct a 95% confidence/credible interval for the mean and variance using conjugate priors

I am looking for information on how to solve this problem above in R. It does not have to be solved using any specific dataset but I would appreciate an example. I am unsure of conjugate priors. ...
15 views

### linear fit using gam in R (mgcv)

I compare different gam model fits, and I want to know if supposing a null smooth term dimension argument (k = 0) is equivalent to a linear regression. lets take ...
15 views

### Are there any practical differences in fitting a random slope vs. fitting an interaction term in the intercept in lmer

I am trying to fit a few models with the form ...
12 views

### Is this approach the right one in Cox with time-dependent covariates in R?

first of all I would like to thank you for reading my post. Then let me describe my situation: I'm trying to develop a Cox model with time-dependent covariates. I have a dataset of patients with ...
21 views

### colour outliers from box plot in scatter plot r [migrated]

I captured outliers of Days variable of a dataset usairnew in bout as given below: ...
18 views

### Inverse Regression vs Reverse Regression

I'm aware there's a great number of questions which deal with the mathematical difference between the two, but I'm still confused as to best practice. Basically I'm looking at a situation where we ...
13 views

### Impute Continuous Predictor which 0 or median is not an option

I have a dataframe of the following patients: PatientID Days.To.Develop.Symptoms 1 0 2 1 3 3 4 NA ...
22 views

### Using caret::sbf to apply feature selection where features are selected over different threshold scores

I'm aiming to use caret::sbf to filter a large number of predictors before using different machine learning models to predict a binary outcome. I would like to filter for variables that are identified ...
16 views

### Can I adjust the relative influence of observations in a mixed model in nlme or lme4?

Is there an equivalent of lm's "weights" argument for nlme or lme4 ? Here's an example to illustrate my question in case it isn't clear enough: I have data taken from 3-5 trees at 3 sites. From each ...
27 views

### Interpreting interaction from two-way anova table

I've conducted three pairwise comparisons of variables and the results were as below: ...
22 views

### R: Help: model selection when summary(lm) shows significant effect BUT anova(model2, model3) does NOT?

All is in the title, but here are the details: ...
8 views

### Difficulty obtaining fit for piecewise SEM (structural equation models)

I have been trying to run Piecewise Structural Equation models on my community mesocosm experiment. I am using piecewiseSEM package, along with the packages lme4 and nlme. I have tried two different ...
25 views

### A statistical function that compiles a curve to a number? [closed]

My title reads itself...If that's even what that means. Forget it. I need to compare some data curves over time for each of the 50 states and see which state is the closest to say, New York. I am ...
14 views

### How to compare linear vs negative binomial vs random fit for data?

I'm trying to plot number of offspring (x-axis) vs size of offspring (y-axis). I want to check if the size of offspring has a linear, or negative binomial or randomly fit. I'm trying to statistically ...
14 views

### How to draw bar plot using frequency table in ggplot2 [migrated]

data.frame format: a <- data.frame(c(1,2,3),c(3,2,1)) colnames(a) <- c("A","B","C") rownames(a) <- c("X","Y") A B C X 1 2 3 Y 3 2 1 How to use this ...
33 views

### Stepwise regression in R - what's my alternate?

Details I'm building what is called a direct demand model for predicting boardings at rail transit stations. The most available example is Transit Cooperative Research Project report 16 (TCRP 16). I ...
6 views

### How to install ConvergenceConcepts in R? [closed]

So, I have a R 3.6.3 version and I need to install ConvergenceConcepts package but I am thus far unsuccessful. When I try to install this package, R throws me this message: ...