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.

20,775 questions
Filter by
Sorted by
Tagged with
257 views

How can I fit a spline to data that contains values and 1st/2nd derivatives?

I have a dataset that contains, let's say, some measurements for position, speed and acceleration. All come from the same "run". I could construct a linear system and fit a polynomial to all of those ...
30 views

Why do a paired t-test and lm give different t-values in R? [closed]

I was playing around with some data, trying to get a grip on doing contrasts for within-subjects designs in R. I've noticed that, as far as I can tell, using lm or <...
20 views

Why can removing a non significant interaction term from a factorial ANOVA cause a main effect to become significant?

I'm running a 2x2 ANOVA analysis in R - the model is linear. The maximal model (containing a continuous DV, one 5-level categorical IV, one continuous IV and the interaction term) yields an output ...
35 views

How to decide threshold values for AUC?

With respect to the pROC package for R(https://rdrr.io/cran/pROC/man/ggroc.html). ...
10 views

How to properly perform “change from baseline” (pre-post) analysis adjusting for pre using lme4 in R?

Let's assume I have the following data set, consisting of pre (t1) and post (t2) measurements. I want to check, if there is a significant effect over time (t1, t2). ...
36 views

Poisson on frequency data with many 0, underestimated output

I have got a frequency table of how many events occur within a 5-minute time window. ...
96 views

Why do these independant variables have significant explanatory power, when 'theoretically' they should have none? (Self contained example inside)

I am putting together a model which involves a simple linear regression, and to aid the development I have put together a process for generating synthetic observations. The idea is that you have ...
29 views

Planned comparisons with ridge regression

I have a data set that consists of 1 response variables (e.g., response time) and 20-30 predictors variables with a mixture of categorical and continuous data. I code the categorical data into dummy ...
11 views

Can I use partial eta and/or partial omega squared for effect size estimation of each independent variable in linear mixed model regression?

I need to estimate effect size estimation of each independent variable in linear mixed model regression. Here is a code: ...
15 views

34 views

Using Logistic Regression to simulate data

I want to simulate data of the form: $$Z=e^{X_1+X_2}+X_3 + \epsilon$$ for i.i.d. $X_1,X_2,X_3\sim\mathcal{U}(-1,1)$ and $\epsilon\sim\mathcal{N}(0,1)$ I have (using R) generated 10,000 ...
19 views

Power analysis in R - Sample size

I have a question regarding power analysis in R using the following function: library(pwr2) pwr.2way(a=2, b=8, alpha=0.01, size.A=12, size.B=12, f.A=0.47, f.B=0.4) ...
12 views

How to validate Item-Based Collaborative Filtering?

So, I made an books recommender system engine (with R) which based on item-item matrix. I've made the whole system fully works the output will give 5 recommender system. But, the question is how can I ...
99 views

What do bootstrap points indicate in a Cullen and Frey plot?

I have a set of 10 samples as follows: ...
53 views

GLM model interpretation of quasi poisson incorporating dispersion in R

I am fairly new to GLMs, and am currently working with a quasipoisson distribution due to overdispersion. I have read through the relevant sections of Mixed Effects Models and Extensions in Ecology ...
29 views

What is the best programming language and regression method for this private equity investment dataset? [closed]

The excel (can be csv) dataset I want to work with has thousands of company names, and for each company, a few rounds of investment. This means many mentions of the same company but with different ...
21 views

predicting X values from smooth.spline

I have an existing smooth.spline object, and I wish to estimate X values for a set of new Y values. I see that ...
19 views

Anova output Variables meaning [closed]

I have this output from R that I'm trying to understand. I would gladly appreciate any help! ...
11 views

Inter-rater reliability or intraclass correlation for one subject

I'm looking for a way, in R, to get measures of agreement for each item. I have 32 ordinal items (we want separate statistics for each), and 66 raters.I have two subjects, but we want to look at the ...
15 views

RCB ANOVA: Degrees of Freedom wrong?

I am running an ANOVA analysis on randomised complete block RCB design: 7 Genotypes 6 Blocks Ratings The model I am fitting is: ...
37 views

How to deal with zero-inflated proportional data in GLMM?

I have proportional data, i.e. number of individuals out of 6 that choose a certain option in a multiple choice experiment, so there are just 7 possible outcomes for each option: 0/6; 1/6; 2/6; 3/6; 4/...
19 views

Levene's test with a two-way anova

I am trying to perform a levenetest on my two-way anova. leveneTest(Score ~ Party + Group, data = Data) But R just screams at me saying ...
13 views

Logistic regression for repeated measures using R [closed]

I'm trying to build a logistic regression model for a longitudinal data. The outcome variable is the status which says if the respiratory status is either poor or good. Each pacient/subject was tested ...
18 views

conversion of multivariate time series into functional data analysis

i am trying to generalize the functional autoregressive model of order one to some order p, for this i calculate the functional principle components, and choose a particular pcs which explain a given ...
42 views

How to calculate an effect size for chi-square in R

For the life of me I cannot figure out how to do something that should be so simple. I have found http://www.real-statistics.com/chi-square-and-f-distributions/effect-size-chi-square/ but it gives no ...
54 views

How to interpret linear regression coefficients from R summary?

We are trying to understand the impact of number of workdays on sales. Please find reprex below: ...
24 views

How to encode Times within Days in Multi-level Mixed Model in R?

I have the following experiment: I tested 16 subjects on 4 different days with a (repeated) measurement every 20 minutes for a total of approximately 15 measurements/day. I have about 4 time varying-...
25 views

Why are my confidence intervals much larger in glmmADMB than glmer.nb?

I'm plotting 3-way interaction terms from a negative binomial models, and tested the models in two packages to check my work and as a sensitivity analysis. I used the effect function to extract the ...
44 views

What is the appropriate data to display with linear regression?

What should be included on a graph with a linear model with a significant p-value? I see a lot of different regression graphs displaying everything from Pearson correlations to the linear model ...
24 views

System is computationally singular due to small numbers in linearHypothesis

Ok, so here is the code that demonstrate the problem I am referring to: ...
39 views

RandomForest ROC curve [closed]

How can I draw the roc curve of this model? ...
32 views

Interpret randomForest Call Results [closed]

My model Call of randomForest is : ...
30 views

randomForest same formula different results (with same seed!) [closed]

I am using randomForest function with same seeds, but gives different results. (with Boston dataset) ...
49 views

What statistical analyses should I use? [closed]

I am doing the last few analyses for my honours thesis, and am currently stuck on some issues. What I'm interested in doing is correlate 5 fmri connectivity values to 3 behavioural measures (i.e. ...
26 views

grid of colored squares data visualization [closed]

I am looking to represent something that is say, 998 for and 2 against as a grid of 998 green squares and two red squares. Is that a plot type, hopefully with an R package that does it? If you are ...
28 views

Paired sample, quasi-matched controls, and a covariate - ANCOVAs in R?

I have been going around in circles on this question for a while, so figured I'd resort to the expertise on stackexchange. My data: I have performance on a multitude of functional tests taken at 2 ...
19 views

Default threshold in cross-validation metrics - h2o R package

I created an cartesian grid of GBMs using h2o package in R and saved cross-validation metrics for each model in a data frame. So, for each model, I stored the ...
33 views

Linear model with and without intercept [duplicate]

This question is based on Everitt et al. (A Handbook of Statistical Analyses Using R) and I am trying to answer these questions: Load the Default dataset from <...
62 views

Regression Modelling of Linear, Exponential, and Power Curves in R [closed]

Please note this is cross-posted: https://stackoverflow.com/questions/57982488/regression-modelling-of-linear-exponential-and-power-curves-in-r I am trying to model reaction time (and other) data ...
63 views

How many iterations are too many?

I have the following model: ...
36 views

Understanding PCA done on permuted data [duplicate]

Apologies if this has been asked before, nothing turned up when I tried to search. I'm noticing some very interesting behavior when I try to do PCA on pairs of some dummy datasets I just invented, ...
18 views

How Many Residuals Should There Be for a One-Way rmANOVA?

As explained broadly across this site and in the stats literature, it is useful to check the assumption of normality in your ANOVA (analysis of variance) by plotting a QQ plot of the residuals of your ...
7 views

Concomitant Variables in Finite mixture Models

On what basis does one decide whether a variable is to be taken as a concomitant variable in a finite mixture model (using flexmix in R)? With experimental data this seems easy to answer, but what ...