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
1 vote
1 answer
29 views

Goodness of fit test for partial proportional odds model in R?

I have fit two partial proportional odds models in R using the clm() function from the ordinal package, with nominal effects (more on the function and package here)....
2 votes
1 answer
84 views

Functional analysis in R with fda

I'm working with time series data for drug response. And, I wanted to as is there are some alternative ways to analyse it since the FDA package in R is not working in my case. The type of my data is ...
1 vote
0 answers
24 views

Could I use LDA (Linear discriminant analysis) for outlier detection?

Could I use LDA method to separate outlier from major points? I want to find outlier from certain data with LDA, but I couldn't find use of LDA for outlier detection. Basically I want do the work like ...
2 votes
0 answers
30 views

What should be displayed on the x-axis of a funnel plot for a meta-analysis model that does not contain any moderators? [closed]

I have performed a meta-analysis with the follwing attributes: meta_escalc <- escalc(measure = "MN", mi = mean , sdi = SD, ni = ni, data=data ) ...
0 votes
0 answers
20 views

Multilevel (Hierarchical) Bayesian Model in R

I have my dataset with different mutations as unit of analysis. These mutations belong to 5 different classes. Also, I have collected, 9 features about these mutations. In other words I have 12 ...
0 votes
1 answer
61 views

How to correctly set up my mixed-effect model?

I have data on days in which the greening of trees happen across America in 2015. This includes meteorological and topography data etc. I want to predict the day of greening happens through a linear ...
  • 418
2 votes
2 answers
41 views

Comparing emmeans values multinom model

I am performing quite some binomial/multinomial models for my thesis. After doing the emmeans statement, I used the contrast statement to compare the emmeans of the different groups. But, I ...
  • 21
1 vote
0 answers
27 views

duplicated variables for different components

I'm presently evaluating the position of individuals of an 3 populations of an animal (according to their sexe) in function of the environmental factors (12) present in their habitat. To detect which ...
0 votes
0 answers
27 views

Compare R2 and Pearson correlation in different models

I have a data set with two variables (var1 and var2) and two binary variables Sex (1,2) and Time (1,2). Therefore, I have four groups. I have calculated pearson correlations and R2 for the four groups....
3 votes
1 answer
25 views

Evaluating goodness-of-fit for GARCH models in R with QQ-plots (rugarch package)

I'm currently working with multivariate GARCH representations of time-series for financial data using the rmgarch R package. This package in turn uses the well-...
  • 31
3 votes
1 answer
79 views

What interpretation do REML/fREML values provide in generalized additive models (GAMs)?

I'm continuing my slow trudge through Simon Wood's book on generalized additive models (GAMs), and it has given me some new useful insights. However, I am still confused after reading through Chapter ...
1 vote
2 answers
28 views

What is the difference between these two mixed model specifications?

I've been running several mixed linear models in R. I use the lmer function from lmerTest. I also ran the same analyses (or so I thought) in JASP. JASP uses R ...
0 votes
0 answers
17 views

Multiplying coefficients of logistic regression to get per 10 unit increase?

I'm working on a project in R where I'm looking at California's census tract-level demographic data in an explanatory logistic regression model. I have 6 demographic variables of interest and am ...
0 votes
1 answer
13 views

Why is standard error of clustered observations not under-estimated?

I regularly read that clustering will cause standard errors to under-estimated. So I simulated two distributions - one with clustered observations, one without. In both cases the standard error is 0....
  • 13.2k
0 votes
0 answers
12 views

DHARMa plots diagnostic

I have performed a linear regression analysis using R and generated some diagnostic plots by using package DHARMa (in R). However, I am having trouble interpreting these plots and would appreciate any ...
0 votes
1 answer
32 views

Can you impute (predict) missing continuous data using categorical data as the predictor?

I just read that to use MICE Imputation, variables with missing values need to have a relationship to other variables. In my case, I will anonymize the variable just for convenience purposes: ...
0 votes
0 answers
23 views

How to fix this wrong amplitude in the bsts-model of temperature time series data?

I'm trying to fitting this bsts-model with some temperature time series, the period is correct, but the amplitude is wrong; can anybody help me fix with this or tell me what to do? data is here: data ...
0 votes
0 answers
23 views

Standardize linear regression with single contrast coded predictor

I am trying to fully standardize a linear model which I am running in R using "lme4". However, I am not really sure if I am doing it correctly. The model consists of a continuous outcome ...
  • 51
0 votes
0 answers
20 views

How to get Random Effects Estmates by hand on R?

Consider the following toy panel data: ...
  • 228
0 votes
1 answer
26 views

How get survival function estimates from Aalen's additive regression?

The Aalen model assumes that the cumulative hazard H(t) for a subject can be expressed as a(t) + X B(t), where a(t) is a time-dependent intercept term, X is the vector of covariates for the subject (...
  • 561
1 vote
1 answer
29 views

Regression analysis with constant dependent variable

Can someone explain to me what's going on in the following? Suppose we have data with constant dependent variable: ...
  • 13
3 votes
1 answer
46 views

Interpreting ordinal regression output in R polr()

I ran an ordinal regression in R using polr(), and have checked the proportional odds assumptions with brant() from the brant package. I am very new to ordinal regression and I am a bit confused about ...
0 votes
0 answers
10 views

Translate R output for regression with SARIMA errors to an equation

I am trying to write the regression generated from the below function in R: ...
  • 1
0 votes
0 answers
13 views

BSTS package cannot capture seasons in simulated data

I am self-learning about structural time series, and for me the best way to understand topic is to simulate the data myself. I want to simulate a time series of local level model with seasonal ...
  • 159
0 votes
1 answer
24 views

Interpreting regression and variable set-up

Im working on a quantile regression model where I look at how imports (impi,t) of intermittent electricity (inti,t) such as wind solar from country i in period t impact day ahead prices in Norway in ...
  • 11
1 vote
0 answers
13 views

Understanding the matching propensity score

I am currently using the package PSweight from R to do propensity score with 2 different methods : IPW and Matching. I first used it to make a propensity score based on IPW method to get the average ...
  • 11
0 votes
0 answers
18 views

If it is a good graph to show the relationship between the training error and test error after using optim function?

The following is code for optimization, during which I calculate the validation error(or test error) too.But I am not sure whether it is a good graph or if there is some problems with my code.Please ...
0 votes
0 answers
8 views

What post-hoc steps to take after nonparametric MANOVA with binary dependent outcome variables?

I am conducting a nonparametric MANOVA to see the effect of Group on each of the four binary response variables (DV1, DV2, DV3, DV4) after controlling for a covariate Cov1 (One-way MANCOVA) using ...
  • 1
1 vote
1 answer
70 views

Identifying root cause of very poor Random Forest model

I've been working on building a random forest model using h2o.ai in R for climate data. I know that there is some issue, either with my understanding of randomforest, code or dataset. However, I'm not ...
0 votes
1 answer
17 views

What is the difference between z-value and the Wald statistic in the summary function of the Cox Proportional Hazards model of the “survival” package?

When I run the code posted at the bottom (using the summary() function of the R survival package, I get the output shown ...
0 votes
1 answer
36 views

Interpreting coefficients of beta regression

I have implemented a beta regression and am a little confused on how I should interpret the coefficients of my model. For context, both my independent variables and dependent variable are expressed in ...
  • 21
0 votes
0 answers
9 views

Cascade Random Forest models or tuning?

I'm pretty new to Random Forests and Machine Learning in general, so if you see an alternative to my approach I'll appreciate any suggestions. I want to create a model that classifies particles into 5 ...
  • 1
0 votes
0 answers
31 views

What distribution and link function should I used for analyzing proportions?

I have a dataset were a small number of individuals were sampled each year for their sex. I would normally use a binomial model (link = logit), to analyze sex ratios, however, in this system, the ...
  • 167
1 vote
0 answers
44 views

How to use R glm() to estimate risk ratios and ratio of risk ratios with confidence intervals

Given these data, reflecting individual data on 206 subjects, two treatment groups ("uc" and "texting") and race ("nonblack" and "black"). My goal is a ...
  • 121
0 votes
0 answers
25 views

Transforming predictors for multiple regression in R

I am trying to perform a multiple regression in R. However I am having hard time to interpret the plots or decide what kind of transformation might be needed. Here is a scatterplot matrix with all my ...
  • 1
0 votes
0 answers
20 views

Simulating data to calculate power for a logistic model

I am new to R and would like to follow the answer to this: Simulation of logistic regression power analysis - designed experiments I would like specifically to know if I have power to detect a ...
0 votes
2 answers
27 views

I have a moderate to high correlation and a p-value that is non-significant. Do I still reject the whole hypothesis?

I have a correlation of 0.777 but only a p-value of 0.069 (not significant) on my Pearson's test. My sample size was of 54. Should my hypothesis still be rejected even if there is a correlation? Is ...
1 vote
1 answer
23 views

Effects of 'Select = TRUE' on covariates in GAM

I'm modelling binary ecological data using a GAMM and I'm having trouble understanding what the 'Select = TRUE' option is doing. As I understand it, 'Select = TRUE' is meant to add extra penalization ...
  • 915
2 votes
0 answers
14 views

Variance Homogeneity for a mixed model

I have run the model: model2 <- lmer(tas ~ station + (1 | date), data = all5) where station is a categorical variable with 4 ...
  • 139
0 votes
0 answers
22 views

Should I use MICE Imputation or Other Method in this Case?

I'm building a beginner data analysis project and have been stuck on this problem for almost a month. I'm analyzing a TV Brand E-commerce dataset from Kaggle with several missing values. The dataset ...
3 votes
1 answer
42 views

pROC package - sensitivity and specificity calculations

I am using the pROC package in R to generate ROC curves. Using the "coords" function, I can extract the sensitivity (Se) , specificity (Sp), negative predicted value (NPV) and positive ...
  • 119
0 votes
1 answer
21 views

Testing the interaction of B:C on a glm using the analysis of deviance in R

A glm, where the response is Poisson distributed, is tested by using the analysis of deviance. In R the model looks like this: ...
  • 41
1 vote
1 answer
30 views

Interpreting shape and rate parameters from a weibull model of mortality hazard in BaSTA

I am using the BaSTA package in R to estimate sex differences in survival parameters for a capture-recapture dataset. When I use a simple Gompertz model the parameters are very interpretable (b0 ...
  • 21
1 vote
1 answer
38 views

Interaction variables with percentage/share

Im currently working on a regression model that looks at how the electricity price is impacted by imports of intermittent (wind, solar) electricity from interconnected countries. In the research ...
  • 11
0 votes
0 answers
20 views

Clarification of one sided vs two sided p value following permutation testing

I am unsure as to how to compute a two sided p value following permutation testing, following different examples online. For example, this post Two-sided permutation test vs. two one-sided, gets the ...
  • 23
1 vote
1 answer
32 views

Rendering the decision tree as a step function [closed]

I am trying to fit a decision tree on a data with only one explanatory variable and both explanatory and response variables are continuous. I believe in such case the result tree is almost like a step ...
  • 13
0 votes
1 answer
30 views

How to perform Kaplan Meier of Relapse/Disease Free Survival?

I'm a new learner to R. I can properly find a KM curve for Overall survival, but stuck when it comes to relapse free survival. In RFS, is your time to event the time to relapse vs censoring? How do ...
user avatar
1 vote
0 answers
15 views

Hopkins statistic - to exponentiate or not to exponentiate?

I wanted to cluster https://www.kaggle.com/datasets/iabhishekofficial/mobile-price-classification?resource=download data. I used 2 different R implementations of Hopkins statistic: hopkins::hopkins() (...
0 votes
0 answers
16 views

Gaussian copula: how to scale data back to get target covariance matrix (not correlation)

I would like to use a Gaussian Copula to simulate data with a given covariance matrix and given marginal distributions. I understand that the input to the copula cannot be the covariance matrix $\...
  • 3,025
1 vote
1 answer
28 views

How to code survival data so that sarting survival is below 1

I am analysing the time to the end of rehabilitation; however, not all patients receive rehabilitation. Therefore, for making Kaplan-Meier curves for the whole study population (including non-...
  • 2,005