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
0answers
3 views

Using ezANOVA or ezMixed

I am fairly new to R and have looked into other answers found on SE and SO but still do not feel that my case matches other posters' data. I would like to perform a Repeated Measures-ANCOVA on the ...
-1
votes
0answers
11 views

How to retrieve the data frame used in a GEE model fit? [migrated]

I have a longitudinal data frame with multiple rows per id. ...
0
votes
1answer
20 views

Schoenfeld test (cox.zph) shows no covariate violates PH assumption but global test suggests whole model does (p<0.001). What to do?

Using cox.zph (part of the survival package), I find that no covariate violates the PH assumption in a Cox regression model (p > ...
0
votes
1answer
20 views

How do I predict future scenarios after training and validating my model?

Problem I'm new to machine learning and need a little activation energy to get me past this sticking point. I've trained/validated/tuned, and tested a random forest model. Therefore, I've used my ...
0
votes
0answers
11 views

Understanding LASSO Regression Using glmnet package [on hold]

I am learning about LASSO and I am trying to do an example from website. I'm following along the example, and I am having trouble understanding the warning ...
0
votes
2answers
45 views

how to deal with panel data using linear regression

i have a data set that with several columns about the top 5 managers in 100 firms from 2009 to 2018, some managers still the same through years and some had been changed for some firms in some years ...
0
votes
0answers
16 views

predicting future orders based on past ordering data [on hold]

I'm a student and as my project problem statement is as follows: a company has provided ordering data ( SKU, quantity,date of order, customer name) of past 3 years in form of an excel file. we want ...
0
votes
1answer
45 views

Basic AB Testing with R

Suppose there is an email campaign for customers. There are two equally divided groups A and B. B received an email with "Offer ends this Saturday. Use code B!". A did not receive the email. How ...
1
vote
0answers
6 views

Power and sample size estimations, how to standardize and compare to previous research. MLR or Correlation for effect size?

Ok, there are a couple of questions here to be honest, Background: I am assessing if thinking,(INFP (Likert scale, 4 subscales) and CT (Likert, two subscales) predict (other-rated) perceptions of ...
2
votes
0answers
28 views

Convergence rate of the maximum of Weibull random variables to a Gumbel distribution

Given a sequence of iid samples $X_1, \dots, X_n,$ where each $X_i$ comes from a Weibull distribution with shape parameter $k$ and scale parameter $\lambda$. Then it is a well-known result that the ...
1
vote
0answers
27 views

Supervised random forest worked example [on hold]

I'm following the first 3 steps for unsupervised random forests from here https://journals.plos.org/plosone/article/file?id=10.1371/journal.pone.0122705&type=printable The steps are: The ...
1
vote
1answer
15 views

GBM: How to interpret relative variable influence

I recently used the gbm package in RStudio for my analyis. All worked well. But I struggle to understand the summary of the model. How to interpret the relative ...
0
votes
1answer
12 views

Is it necessary to scale the dependent variable in k-NN regression?

I want run kNN analysis to predict Y (continuous variable). I know that it is necessary to normalize all of the Xs. My question: is it also necessary to normalize Y values?
0
votes
1answer
21 views

How to fit a zero-inflated quasi-poisson distribution to a continuous variable using GAM

I am trying to fit a GAM to a continuous variable which is zero-inflated. However, since my variable is continuous, I am not able to use ziP() for a zero-inflated quasi-Poisson. Is there someway to ...
2
votes
0answers
22 views

Peeking Inside the Black Box, can Feature importance indicate overfit?

my basic question is: can permutation feature importance be used to identify overfitting? when you have a binary classifcation problem with balanced classes (i.e. 70 x yes, 70 x no), when none of the ...
0
votes
0answers
11 views

Johansen-Procedure Unit Root / Cointegration Test in R

I try to receive Johansen-Procedure for 4 variables (21 rows) in R (urca package) Input: ...
0
votes
0answers
30 views

Shrinkage Parameter for LASSO (glmnet package in R)

I am using glmnet package in R-software to build a Binary Logistic Regression with the LASSO. I have used the following link as ...
-2
votes
0answers
17 views

about the microbiome data [on hold]

When we use nonmetric multidimensional scaling for microbiome data using vegan package in R, can we use raw count OTU data? or do we need to perform total sum scaling normalization or cumulative sum ...
0
votes
0answers
21 views

Dynamic regression, models with coefficients = 0 chosen as top models

I am running auto.arima on part of a time series (training data) using all possible combinations for several external regressors. I then choose the top 5 models according to fit to testing data using ...
0
votes
0answers
7 views

Analyzing repeatability using rptR package with binary data, CI doesn't match estimated R [on hold]

I'm using the rptR package in R with the following code: rpt(SUCCESS ~ TRIAL + (1|SUBJECT), data=phase1, datatype ="Binary", grname="SUBJECT", nboot = 100, npermut = 0, ratio = TRUE) I've also ran ...
0
votes
0answers
10 views

Generating random values from a multivariate skew-normal with fixed marginals

I'm generating random values from the multivariate skew-normal, and I want that the marginal distributions from this multivariate one have fixed parameters as the following: I'm generating from ...
1
vote
1answer
30 views

Overfitting model or issue of categorical predictors?

Is it possible to overfit a model by virtue of having too many categorical variables? I have 3 categorical variables and my dependent measure is continuous (or a ratio I guess, I'm measuring ...
0
votes
1answer
34 views

Dynamic Time Warping vs Cross Correlation

Consider the following data frames: > df1 value 1 6 2 2 3 3 4 1 > df2 value 1 3 2 8 3 4 4 5 I want to find the ...
0
votes
2answers
45 views

Statistical evidence that the AUC was not overfitted to the model. With N=119, C-stat = 0.81 seems optimistic. Optimism-adjusted?

My data have 119 cases and we did ROC for x (continuous variable) to predict postoperative y (categorical variable) available here, we got a comment from a reviewer asking: Please provide ...
0
votes
0answers
14 views

Statistical evidence that the AUC was not overfitted to the model. With N=119, C-stat = 0.81 seems optimistic. Optimism-adjusted? [duplicate]

My data has 119 case and We did ROC for x (continuous variable ) to predict postoperative y (categorical variable) available here, we got a comment from a reviewer asking "Please provide statistical ...
0
votes
0answers
6 views

Regression with an array instead of column as features in R [on hold]

I would like to know if it is possible to do a regression with features that will be in a single column and how to do it. Example. Let's say my dataset is like this: ...
0
votes
0answers
11 views

How to create an R vector to represent a log-uniform prior distribution? [on hold]

how can I create an R vector to represent a log-uniform prior distribution? where the probabilities are proportional to 1/β. Thanks ...
0
votes
0answers
16 views

Derive and calculate winning probability of solitaire 1-2-3 [on hold]

There is a simple solitaire that involves a 40 card deck, 4 suits each with 10 cards from one to ten. It develops as following: Card Shuffling Start drawing from the deck one card at time and ...
1
vote
0answers
12 views

What is the interpretation of polynomial terms for ordered factors in Ordinal Logisitic Regression

I am creating an OLR model using R with the polr function in the MASS package. All of my predictors are also ordinal data, all of the data is the integers from 1 to 5 coming from a customer survey. I ...
0
votes
0answers
16 views

Calculating the tangency portfolio in R [on hold]

I have created a function for portfolio optimisation in R using the quadprog package. Everything works fine and the solutions correspond to the solutions I get with fPortfolio and PortfolioAnalytics, ...
2
votes
2answers
40 views

Binomial proportion confidence interval when rigid bounds on population proportion (0.5 < p < 1)

A standard problem is estimation of confidence intervals for a population proportion given that one has observed f successes out of n independent trials. There is a reasonable discussion of this ...
1
vote
1answer
15 views

Regression with paired, repeated measures design

I have a large population of books. Each book is either a hardback or softback (thus hardback and softback books are paired with one another by title), and can fall into two categorical genres - ...
0
votes
0answers
10 views

How to denote letters in two way interaction in Rcmdr/ [on hold]

How I can denote letters in a two way interaction after post- hoc analysis in R commander. Any help is appreciated
0
votes
1answer
7 views

Converting 1 row instance to a suitable format in R for repeated measures ANOVA [on hold]

I'm really struggling with how to format my data to a suitable one in R. At the moment, I have my data in the format of: ...
0
votes
0answers
16 views

Time-series decomposition with multiple seasonality

I'm trying to extract the trend of a daily time-series in R. I've tested the 2 following methods, but I'm not sure which one to pick. Are there any criteria I can apply to choose objectively? Method ...
0
votes
0answers
18 views

power analysis: power.t.test and power.anova.test result different?

When the number of groups is 2, the result of power.t.test and power.anova.test should be the same. However, the following code ...
0
votes
0answers
4 views

R pglm marginal effects [on hold]

Is it possible to get marginal effects or group intercepts so that I can calculate them myself for pglm nonlinear models in R?
0
votes
0answers
23 views

calculate type III SS of the intercept term manually [on hold]

my question is: how can calculate type III SS of the intercept term manually in R, without using the function car::Anova? I have wrote the code below to calculate all the type III SS of the regression ...
1
vote
0answers
23 views

what is the model for all random effects multilevel nested anova in lmer()? [on hold]

Is it lmer(y ~ 1 + (1|a/b/c) or lmer(y ~(a + (1|a/b/c))? The first input gives a blank output for ANOVA and I try to get an ...
2
votes
0answers
12 views

What model to use to evaluate whether the “variability” of one variable is determined by the “variability” of other variables?

I have observations taken for four subjects at a number of points/locations. The data is formatted similarly to as below: I am not directly interested in the impact that a predictor has on the ...
0
votes
0answers
7 views

Twoway fixed effects with pglm (and plm) package

I'm trying to estimate a poisson model with location and time fixed effects using the pglm package in R but noticed that including the time index has no effect on the output and seems to be ignored by ...
1
vote
0answers
11 views

Confidence interval of amplitude and horizontal shift

I have a linear model with sine and cosine wave as predictor. Y~$\alpha$sine(...)+$\beta$cosine(...). From the parameter estimation, I know the estimation of the coefficients are: $\hat\alpha$ = 0.65(...
1
vote
0answers
10 views

Changing lattice coplot strip font [migrated]

I'm trying to change the size of the strip text for biom and days. I saw other posts suggesting to use ...
0
votes
0answers
6 views

Cross-classified multilevel model with lagged dependent variable Using R

I am a bit stuck with my model and I wonder if this is even possible using R. Basically I want to use a lagged dependent variable (LDV) in a cross-classified multilevel model (MLM). Following remarks ...
0
votes
0answers
12 views

Simulated Regression - getting the population like data

I try to evaluate measures for Feature Importance for a regression. I have data set with highly correlated features. So the betas have a variance. This makes it difficult to estimate the "true betas" (...
0
votes
1answer
10 views

Does R Chi-Square test consider the order of a ordered factor?

I would like to test if there is an association between: -A binary factor: 0, 1 (recovered vs not recovered) -A ordered factor: Iron level 1, 2, 3 (low, medium, high) I was wondering if the rank of ...
0
votes
0answers
22 views

How to estimate a Quantile-on-Quantile regression in R? [on hold]

Given two variables, X and Y, how to estimate a Quantile-on-Quantile regression in R? Thank you.
0
votes
0answers
5 views

Significance of hyper parameters in the DHR model in R forecast package

The Dynamic Harmonic Regression model in R requires the input of parameters K, the length of which depends on the number of seasonality in the forecast data. According to https://otexts.com/fpp2/dhr....
2
votes
0answers
29 views

How to interpret a False Discovery Rate plot

It is the first time that I am trying to calculate the FDR and I use the fdrtool package in R. I want both, local and tail area graphs and I think the third ...
0
votes
0answers
18 views

clogit and odds ratio curve using R

I am trying to plot a continuous variable effect as an odds ratio (OR curve over a continuous variable with restricted cubic spline) using clogit(conditional logistic regression) in R. ...