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
13
votes
3answers
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 ...
1
vote
0answers
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 <...
1
vote
0answers
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 ...
0
votes
1answer
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). ...
0
votes
0answers
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). ...
2
votes
1answer
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. ...
0
votes
1answer
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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: ...
0
votes
1answer
15 views

sum of probabilities doesn't match, using HistogramTools in R

I was using the package HistogramTools in R to create Histogram. > H<-hist(1:100) > sum(H$density) [1] 0.1 Somehow the sum of the density is not 1, ...
0
votes
1answer
30 views

Get odds ratios with confidence intervals from a lasso regression model

I try to understand lasso regression. So far, I do understand that it can be used to shrink regression coefficients in case of few events. The coefficients of some covariates are even shrunk to zero. ...
0
votes
0answers
13 views

Compare responses of two groups of their responses to how they rate their preference

Two groups of respondents where asked to rate their concern on 1-10 Likert scale (which effectively means ranked responses). In effect, for each groups, I have a number of respondents who ranked their ...
3
votes
0answers
56 views

Quantile regression and linear regression coefficient comparison

I am trying to understand the concept of quantile regression by modelling the monthly expenditure on insurance on several variables. The R package ...
0
votes
0answers
23 views

Interaction in a Binomial how interpret

So, my doubt is simple, I ran this model: glm(formula = pregnancy ~ Bull*SEMEN, family = binomial(), data = dt) Just 2 bulls (a and b) and 2 semen (s and c) ...
0
votes
1answer
25 views

checking accuracy of a forecast [closed]

I am trying to predict future sale of a product by using holt-winters imp info: nextsalesf contains the forecast for next 5 periods val$Qty.2011001FBL0010250[5] is the known values of next 5 ...
0
votes
1answer
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 ...
0
votes
1answer
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) ...
1
vote
0answers
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 ...
-5
votes
0answers
99 views

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

I have a set of 10 samples as follows: ...
2
votes
2answers
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 ...
0
votes
1answer
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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! ...
0
votes
0answers
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 ...
0
votes
0answers
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: ...
2
votes
0answers
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/...
0
votes
1answer
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 ...
1
vote
0answers
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 ...
0
votes
0answers
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 ...
0
votes
1answer
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 ...
-1
votes
1answer
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: ...
1
vote
0answers
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-...
0
votes
1answer
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 ...
2
votes
2answers
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 ...
0
votes
0answers
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: ...
0
votes
1answer
39 views

RandomForest ROC curve [closed]

How can I draw the roc curve of this model? ...
-1
votes
0answers
32 views

Interpret randomForest Call Results [closed]

My model Call of randomForest is : ...
0
votes
1answer
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) ...
0
votes
0answers
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. ...
1
vote
1answer
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 ...
1
vote
0answers
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 ...
0
votes
1answer
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 ...
2
votes
0answers
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 <...
3
votes
2answers
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 ...
0
votes
1answer
63 views

How many iterations are too many?

I have the following model: ...
3
votes
0answers
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, ...
0
votes
0answers
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 ...
0
votes
0answers
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 ...
2
votes
1answer
62 views

How is nlme package in R “non-linear”? [closed]

Why is the package nlme non-linear? Is it non-linear in the sense that gee is non-linear because of correlation structure/covariance pattern like exchangeable/AR1? So if we drew out correlated errors ...
2
votes
1answer
44 views

Ordinal Logistic Regression: is it normal to find very high coefficients?

I am running an ordinal logistic regression in R to assess the effect of 3 IVs (GDP, n. of bilateral agreements, HDI - all in log) on the diplomatic ranking (DV) ascribed to different countries (...