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
25 views

Quantile regression model when most values are 0- data cleaning or different quantile?

I asked a question on performing quantile regression on a specific dataset and set of variables (which is unanswered as of now- maybe the question isn't as clear.) The following question is somewhat ...
  • 113
0 votes
0 answers
22 views

Is there heteroscedasticity? R

I'm still trying to understad ho to read these graphs, can anyone help me understand if in this case there is heteroscedasticity? I obatined it using: ...
0 votes
0 answers
8 views

Likelihood ratio statistic differs when computed from logLik, deviance, and anova functions in R

I'm confused about getting different results when trying to perform the likelihood ratio test (LRT) with R in different ways that are supposed to be equivalent. Below is the R code with some simulated ...
1 vote
0 answers
20 views

Quantile regression: getting 0 intercept and coefficients

I have three variables- two independent x1, x2 and one response y1. Scatterplot for the data is, as follows. I want to perform ...
  • 113
1 vote
0 answers
10 views

glmmTMB & glmer: diffrences in results and warnings of a logistic glmm

I was fitting a logistic generalized liner mixed model using glmer from the lme4 package when I stumbled upon the fact that the results change drastically when the order of the data was changed. So I ...
0 votes
0 answers
10 views

Statistical test for heteroscedasticity in R

Is there a test for heteroscedasticity that I can use with a nls() instead of a lm() object? Like The Breusch-Pagan Test but for ...
0 votes
0 answers
22 views

Heteroscedasticity consistent covariance matrix in R

I read in the literature (Long & Ervin (2000)) that HC1,HC2,HC3 etc (used in vcovHC()) were introduced after HC0 because they worked better in small samples. ...
0 votes
0 answers
14 views

Understanding Plots Related to the Variance-Bias Tradeoff and Plotting them in R

I am recreating some of the work by the authors from Introduction to Statistical Learning (2nd Edition) by Hastie et at. This text can be found here: https://hastie.su.domains/ISLR2/ISLRv2_website.pdf ...
  • 195
1 vote
1 answer
25 views

Is data scaling necessary in mars regression?

I am very new to data science. Something struck me about Mars regression. The dataset is not on the same scale, so some columns are %, others are integers. I want to do clustering before doing Mars ...
  • 13
0 votes
0 answers
10 views

How do I create a program to analyze patterns and decode a new sequence in R?

Say I am given these sequences "Up, Down, Left, 1,2,3,4" = 1 "Down, Right, Left, 2,4,3,1" = 4 "Left, Down, Right, 4,1,2,3" = 2. The answer to these 3 sequences are: 1,4,...
0 votes
0 answers
9 views

How could I use past data to interpolate missing environmental date in R?

I have a data across several years in several spreadsheets with ocean data. These are formatted with rows being observations (time series) and columns being different parameters (water temp, turbidity,...
  • 1
0 votes
0 answers
7 views

anova to compare two breakpoint models from R package strucchange

I want to compare two models with differing number of breaks, fitted with breakpoints from the strucchange package. As the the package developer @Achim Zeileis ...
  • 121
0 votes
1 answer
7 views

correcting control-treatment group sizes as expected events (in control) differed

I did a study were my control group (n=6) had an event in 100% of the individuals. I compared the time-to-event of the control to treatment groups (3), each with 6 individuals. The effect size is ...
  • 1
0 votes
0 answers
6 views

One sample against a heterogenous population testing

I have a dataset of about 5000 rows (features), one case column and multiple control columns and controls are naturally heterogenous. I want to test the case against controls. Is it possible to use ...
0 votes
0 answers
23 views

Is mixed effects model the right choice for my dataset? [closed]

Is mixed effects model the right choice for my dataset? I have just finish collect data for my master thesis. In the experiment 29 alpine skiers did a pretest (3 runs), two training sessions (5 run ...
6 votes
1 answer
172 views

Compute median of continuous distribution using integrate() in R

sorry if this may sound very silly or stupid, but I'm following a stats course in my uni and I have some exercises in which I have to compute the median of a continuous distribution. I know that, if ...
2 votes
1 answer
53 views

Why is the upper bound of the 95% CI infinity when using a one sample wilcoxon?

I've been calculating 95% confidence intervals around the psuedomedian in a one sample wilcoxon signed rank tests, with a "greater" alternative and the mu = 0. That is, I have been exploring ...
  • 21
0 votes
0 answers
9 views

Restricted cubic spline with Complex survey data(regression fitted by survey::svycoxph, survey:: svyglm, etc.)

Recently I am working with complex survey data. I use the survey package to analyze the data. I fitted cox proportional hazard model by...
  • 23
0 votes
0 answers
23 views

Is there an acceptable range for the values of MDs and SMDs? If MDs go below and beyond -1 and 1, respectively, are my results still valid?

I'm not certain whether my subgroup meta-analyses that produced extreme(?) values of MD (highest is 13.86 [95%-CI, 12.44; 15.29] and lowest at -15.42 [95%-CI, -20.63; -10.20]) are still valid. I used ...
  • 1
0 votes
0 answers
21 views

How should I interpret this heatmap

I have daily data about Covid19 for 145 countries. I have executed Factor Analysis and I have created a heatmap using the factor scores.In the x axis there is the number of factor and in the y axis ...
-4 votes
0 answers
22 views

Questions on R about matrices, data frames and lists [closed]

I have troubles answering those questions coming from a random generated R questions website... Could someone please help me ? Thanks a lot Create a 56 x 56 diagonal matrix C with elements 1, 2, ..., ...
1 vote
0 answers
14 views

How to generate two matrices with given (constrained to) column-wise and row-wise correlations in R? [closed]

I would like to generate two matrices X and Y, of the same dimensions (n x ...
0 votes
1 answer
25 views

How coeftest(model, vcov=sandwich) works? R

I'm trying to fit a data set using a non-linear model nls() and I have no problem obtaining my coefficients and their errors. I wanted to estimate also Robust ...
0 votes
0 answers
3 views

Is it possible to run spatial regressions with panel data set in R?

I find spatial regressions in R incorporate data which are not panel data from the examples I see. This seems plausible as I find shape files, weight matrices, etc. are not time varying. Is it true ...
  • 404
0 votes
1 answer
20 views

How to account for temporal autocorrelation in ordinal GAM (in R)?

In a model with a categorical (ordered) response, how can autocorrelation of the residuals be taken into account? Apparently, including rho does not work. ...
  • 427
0 votes
0 answers
10 views

How do I check statistical difference in effect size of the random variable from linear mixed effect model?

I have a dataset on green-up days pan-Arctic and relate this to weather variables. I, therefore, have used a linear mixed effect model where region (e.g. Alaska, ...
  • 354
0 votes
0 answers
12 views

Difference between odds and odds ratio? Interpreting logistic regression coefficients [duplicate]

I was wondering what the difference is between odds and odds ratio in logistic regression. I understand that formally, odds is the probability of success over the probability of failure, however, I ...
0 votes
0 answers
19 views

In R, different point estimates of odds ratio from fisher.test() and manual calcuation [duplicate]

In R, I have two different odds ratios from fisher.test() and manual calculation. I do not understand how fisher.test() calculates such odds ratio. Could someone explain it? Also, could you tell me ...
  • 101
0 votes
0 answers
17 views

How to specify a VAR model in R with non-stationary, stationary, and trend-stationary variables?

I have a multivariate time series and I want to estimate a VAR model. I tested for unit roots with the ADF and KPSS test and concluded that some variables are non-stationary, while others are ...
  • 11
1 vote
1 answer
12 views

Why same t-score for contrast pairs involve continuous x continuous interaction (emtrends)?

I want to calculate the difference in simple slope estimates for two-way interactions that involve two continuous variables. But I found the t-score is all the same for the contrast-pair results when ...
0 votes
0 answers
34 views

What is the correct method to compare linear mixed models and select the best one?

Suppose we have four variables, say, x, y, z and w, and we are fitting a linear mixed effects model with x as the target and y ...
0 votes
2 answers
17 views

Adjustment of multiple test in contrasts of contrasts

I have a model where I care about testing the differences among interaction terms. To make is more straightforward, I just use lm The model is : ...
  • 1
0 votes
0 answers
34 views

How to choose the cut-off for a non normal distributed variable

If the centrality indexes (mean and median) differ from group, as shown: ...
0 votes
0 answers
35 views

mccv - gam fit linear

I'm trying to understand (and relate) how much curvature one can expect from fitting a GAM to that obtained from a non-parametric lowess. Is the fact that the GAM fit is quite linear for the two ...
  • 235
1 vote
1 answer
30 views

What is the R function for EDA plots like this? [closed]

I am searching for the R function that generated this Exploratory Data Analysis plot. Anyone know what it is?
  • 105
0 votes
0 answers
32 views

Advice on transforming back the integrated output to real/true values

I see several questions here at SSE about transforming the processed output [0,1] back to real/true values. However, my case is slightly different, where I am using Rfmtool package to do weighted ...
4 votes
1 answer
61 views

bootstrapping a linear mixed model with R's lmeresampler or lme4 or a robust regression?

considering that I have a very small sample and that my residuals are non-normally distributed, I've decided to perform a lmer() with bootstrapping. This is my very ...
0 votes
0 answers
10 views

calculate the reconstruction error as the difference between the original and the reconstructed matrix using SVD in R [migrated]

I am currently in an online class in genomics, coming in as a wetlab physician, so my statistical knowledge is not the best. Right now we are working on PCA and SVD in R. I got a big matrix: ...
  • 1
0 votes
1 answer
82 views

Does this plot indicate the data is normal distributed?

I use qqnorm to plot my data as the photo attached. Does this plot indicate the data is normal distributed?
0 votes
0 answers
48 views

Robust standard errors for Nonlinear Least Squares in R?

How can I estimate Robust Standard errors using a nls() funcion in R? I wanted to fit a model like: ...
0 votes
0 answers
18 views

Interpret variance analysis in R

I would appreciate some help interpreting and inferring outputs from aov() in R, and understand what the next step is in the analysis. Background: I am working with ...
  • 23
0 votes
0 answers
32 views

adding random in R [closed]

So we model a bacteria level, where we denote the threshold value by c. The cell cannot divide towards this number. Since it is not very natural for the cell to know how much this c is, I would like ...
0 votes
0 answers
10 views

NASAaccess package in R [closed]

I'm a research student and I have very minimal knowledge of R. There's a package called "NASAaccess" that I need to use for my work. I'm facing issues in using this package. There's an ...
0 votes
0 answers
9 views

turn Hazard Ratio to exp form in termplot [closed]

I have made a plot by mfit <- coxph(SurvObj ~ pspline(chma08) + v1age01 + racegrp+gender,data=data99) mfit <- eform(mfit) ...
0 votes
0 answers
5 views

How to understand PLSda? [closed]

Using ropls package in R for PLS-DA. Can I change the scales in x-score graph. My graphs were ploted at predI =2. Is it good to use what Q2y score is best to be considered?
-1 votes
0 answers
21 views

Interpretation of coefficient in log-level regression [duplicate]

The result of my panel study with log-transformed dependent variable l_passengers results in a coefficient of 1.15076 of my independent variable lccshare. I'm not quite sure how to interpret this as ...
0 votes
0 answers
16 views

Understanding MFA and MCA with FactoMineR

I'm working on a project where I have to perform MCA and MFA. My dataset contains the following data (for context). Also I created some extra variables: WeightTried* for each lift, that has the ...
0 votes
0 answers
11 views

Post hoc for Repeated measures MANOVA in R?

I'm analyzing a dataset composed of 3 dependent variables (pressure of neck, torso, and lumbar zones) measured in 5 moments (t0, t1, t2, t3, t4). Since interaction between the variables may exist, I'm ...
  • 13
2 votes
1 answer
34 views

How to perform a likelihood ratio test in a new dataset?

I understood the purpose of likelihood ratio test. However, I am confused by the table below from a published investigation. Clearly the author compare a nested model (VMNS) and a full model (VMNS + ...
2 votes
1 answer
52 views

R - Model specification for repeated measures in linear mixed-effect model (lmer)

I am quite new in linear mixed-effects models, and trying to figure out how to properly design my model according to what I want to show (especially with the nesting and random effect). I am reading ...
  • 21

1
2 3 4 5
555