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

What am I looking at here in this regression analysis? [closed]

I have no idea what to do with this information or how it helps me determine if education level influences tolerance towards minorities. Control Variables are age, gender, province, and if they ...
1
vote
0answers
14 views

finding the correlation between population density in a city and the city's PM 25 value

I am a high school student doing a report for my environmental science course, IB diploma. My question is about how to find the correlation between two data sets. My question of interest is whether ...
0
votes
0answers
11 views

miceadds package in R for repeated measures ANCOVA

I am currently attempting to pool results from a repeated measures ANCOVA using a multiple imputation database. I recently read on this site that F-values can be pooled using the mi.combine function ...
2
votes
2answers
59 views

GEE logit / Poisson versus mixed effects Poisson / logit

There's a way to do Poisson or logit mixed effects and Poisson or logit GEE in R. What's the difference between GEE and the mixed effects models for Poisson / logistic regression? I heard its the ...
1
vote
1answer
43 views

Intercept in a Bayesian model with categorical predictors (with brms)

I have a Bayesian logistic model fitted in R with brms. The predicted variable is binomial, the predictors are categorical. The model uses bernoulli family and a ...
2
votes
3answers
22 views

What is the meaning of the beta for the interaction between continuous variables in a linear mixed-model?

If I create a mixed-effects linear regression model similar to the following (using the lme4 package in R), where all of the fixed effect variables are continuous: ...
1
vote
0answers
24 views

Interpreting calibration plots

This is some kind of really specific/multidisciplinar question, so maybe this is not the appropiate place to expose this, as it's quite code-heavy. If that's the case, please inform me! I have fitted ...
1
vote
2answers
22 views

How to estimate proportions of variance in outcome variable attributable to each individual fixed effect variable in lmer?

I am using multivariate models in lme4 to try to work out, quantify and compare the effects on a single outcome variable of a large group of fixed effects variables. Because the data are at week and ...
0
votes
0answers
9 views

Exponential random on clustered graphs

In, short am using time use data and I am aiming to represent the way everyday activities connect in time and space. So i created the above graph in Gephi. The nodes are activities and edges are 2nd ...
0
votes
1answer
24 views

Random Forest yields insanely OOB high error rates

I am using randomForestSRC to fit a random forest of 1000 trees for a 3-class classification problem with 160 cases. I am observing insanely high OOB error rates, sometimes as high as 75%, which is ...
1
vote
0answers
23 views

time-varying coefficients (Cox regression) - interaction terms

I'm fitting a cox regression model that violates the proportionality assumption by breaking the data into three intervals as suggested by Therneau et al. p. 17~ (https://cran.r-project.org/web/...
0
votes
1answer
38 views

Regression: Why does using quadratic expressions work with linear estimators? [duplicate]

My questions is, that I see people using R´s lm() (linear regression model) with Y ~ X^2 e.g. here: Simple non-linear regression problem But I dont see how and ...
0
votes
0answers
22 views
1
vote
1answer
27 views

Interpretation of factor() formula in R while using and plm() or lm() regression command

I have issues with interpreting results as those: lm(formula = LN_CO2_T + ROA ~ SIZE + factor(IND)) , because I do not fully grasp what ...
0
votes
0answers
25 views

How to generate under-dispersed Poisson variables in R?

In this article "generate quasi-poisson distribution random variables", it is shown how to use the function rnbinom to simulate overdispersed Poisson data: ...
0
votes
1answer
23 views

Measurement invariance using 3 items

I want to examine measurement invariance across two nationalities for a construct measured with 3 items. First one is supposed to examine the configural fit before examining more restrictive models. ...
0
votes
1answer
39 views

Tuning SVM parameters in R

I am training an SVM model for the classification of the variable V19 within my dataset. I have done a pre-processing of the data, in particular I have used MICE to impute some missing data. Anyway a ...
1
vote
0answers
12 views

How to back transform the foretasted values from Prophet algorithm?

i have log transformed the actual and fed the data into forecasting model(Prophet) and i have the forecast in scaled to log format. I would like to transform them back to normal values. Should taking ...
0
votes
0answers
3 views

LSTARDL Model fitting

I would like to fit a LSTARDL Model with R, Stata or Rats but everything i saw was on LSTAR Model. My idea firstly was to estimate and ARDL model and then specify the relationship obtained between ...
0
votes
0answers
12 views

Survival Analysis - Describing Results from KM to Cox

I am familiar with the basics of survival analysis although I am stuck in organizing my figures for presentation. I constructed an adjusted KM curve and stratified my covariate of interest by the ...
0
votes
0answers
17 views

Random Slopes and Starting Parameters with GLMMLASSO

I am using glmmlasso in a simulation study. I want to decrease the time it takes to select the tuning parameter, lambda, by using the technique described in this answer: https://stats.stackexchange....
0
votes
0answers
25 views

Can I get the corrected population mean using lmer? Or how can I do this in R, get the corrected mean by model effects? [closed]

I have this model: my_model <- lmer(production ~ (1 | Sire) + Age + GC, data = mydata) And I would like to obtain the mean of this ...
0
votes
0answers
20 views

Difference Between Latent Dirichlet Assignment (LDA) and Discrete Linear Analysis (LDA)

I have been studying some concepts of multivariate statistics and came across two models with the same name and very similar, but with different names. It makes me think they are the same. Can anyone ...
0
votes
0answers
13 views

Repeated measures ANCOVA with between-subjects factor in R or repeated measures GLM?

So picture the following hypothetical design: participants are divided into two experimental groups: (1) happy mood induction and (2) neutral control. So happy/control is the between subjects factor. ...
0
votes
0answers
9 views

How to find joint distribution using copula and NIG(Normal Inverse Gaussian) marginal Distribution in R?

I have a question about finding the joint distribution of marginal NIG distributions using Gaussian Copula. I estimated the parameter NIG using the ...
1
vote
0answers
38 views

Visualising ranked data with distribution and mean

I would like to visualise ordinal data with ranks (1st-4th) in different categories however, I'm unsure how to best go about it. I'd like to be able to see the distribution and the mean ranking for ...
2
votes
2answers
24 views

linear mixed model - post hoc tests for categorical variables against fixed value null-hypothesis

I'm fitting an LME (with lmer in R) with one categorical variable that has many (80) different values. A fitting example for my problem would be how weight loss ...
0
votes
0answers
33 views

Unexpectedly large coefficients in logistic interaction model

I would like to know if you could provide any insights regarding large and unexpected coefficients in logistic models with interaction terms. When running the interaction model, the coefficients for ...
0
votes
1answer
64 views

Visualization associations between the symptoms - categorical data in R

I have a data frame with presence of symptoms which are categorical data (1 = present, 0 = absent). For instance: ...
0
votes
1answer
52 views

Sum of Normal Random Variables | Different Dimensions

I would like to generate one random numer $single\sim N(0,1)$ and create the vector that contains only this one number: $one = [single, single, ..., single]$ . Later, I would like to combine with ...
1
vote
1answer
49 views

Different results from random effects plm (R) and xtreg (Stata)

I'm trying to convert the analysis from an old research paper from Stata to R. However, I ran into a problem that I have been unable to fix. When I compare the coefficients from the two programs, ...
2
votes
1answer
28 views

R Multivariate Normal CDF

I am trying to estimate the CDF of a MVN distribution for some given ranges ([-Inf,mu], [mu,mu+3], [mu+3,Inf]). In R using package mvtnorm and function pmvnorm, with some dummy data: ...
0
votes
0answers
14 views

Chi Square test for negative binomial distribution using R [closed]

I have a table of counts named countDF. I want to take one row from the table and check if it obeys the law of the negative distribution. Here is the code I use: ...
-1
votes
0answers
14 views

Anova for comparing GLM Nested Models? [closed]

I'm absolutely new to the statistical modelling and R. I'm trying to compare two glm models but I'm not sure how to interpret the anova results. Would appreciate if someone can throw a light on my ...
3
votes
4answers
140 views

In R, how do I test $H_0: \beta_1+\beta_2=0$

I am estimating the following model using the lm package in R: $y_t = \alpha + \beta_1x_t + \beta_2 z_t$. I am interest in the ...
0
votes
2answers
13 views

How can I analyse the association between a categorical variable (binary outcome) and a continous variable especially in R?

I want to analyze the association between a binary variable and a continuous variable in R. But I am not clear about what steps I should follow. I explored the continuous variable by the histogram ...
0
votes
2answers
100 views

Sampling highly imbalance multi-class response variable

I have a dataset (11000 x 117) with response variable having multiple classes. Here is a plot of class distribution: Some of the classes have only 1 sample in the entire dataset and some have 2, 3 ...
-1
votes
0answers
16 views

How do I read the R software properly [duplicate]

Hi, basically they tell me "what can you say about this regression using the values that you got from the R software?" ( It's an exercise). Considering that i am "new" with this topic I just want to ...
0
votes
0answers
15 views

Chi-squared - How to deal with replications ; proportion or numbers?

I am studying the effect of different treatments on the number of male, female and hermaphrodite flowers per plant (M, F , H). For each plant studied, I have these 3 numbers.( ex : 250, 11 and 10). I ...
1
vote
1answer
109 views

Pooling across quantile regression analyses from multiple imputed datasets (quantreg, MICE)

We have a dataset looking at predictors of reading comprehension ability, with a few missing data points here and there. After lots of going round in circles I think that multiple imputation is the ...
-1
votes
2answers
32 views

Applying linear mixed model for RNA-Seq data

We have an RNA-Seq data set from mouse with three conditions in triplicates. For better understanding of the reaction, each of the animal was weighted and its urea levels were measured beforehand. We ...
0
votes
1answer
34 views

How to compare a n value to the mean of n-1 ; n-2 ; … ; n-5?

Good morning, My question may be silly and I apologize if it is... I'm working on data which comes from 40 animals monitored during 6 different days at 12 time points each day. I made multiple t-...
1
vote
1answer
56 views

How to calculate the cumulative distribution function of a GEV distribution when $1+\xi(x-\mu)/\sigma\le0$?

I don't have a stats background let alone one in extreme value theory, and I have what I imagine is a simple question but one I that haven't been able to find the answer to. The cumulative ...
1
vote
2answers
27 views

What is the difference between smoothing and decomposition in time series?

i am bit new to time series modelling, currently i am trying to understand some basics. What is the difference between smoothing and decomposition in time series . I have gone through many materials , ...
0
votes
0answers
8 views

How to calculate the cumulative distribution of a GEV when (1 + ξ(x-μ)/σ)<=0? [duplicate]

I don't have a stats background let alone one in extreme value theory, and I have what I imagine is a simple question but one I that haven't been able to find the answer to. The cumulative ...
1
vote
1answer
27 views

Interrupted Time Series with varying intervention dates

I have ~400 time series with measurements of a response variable over the course of 48 weeks. An intervention occurred at week 24 in each time series. A simulated version is provided below: ...
2
votes
0answers
37 views

Shapley value vs ridge regression

My goal is to get the feature importance for multiple regression. I have a data set with some multicollinearity. I found two methods to solve this problem. The first one is the Shapley value. ...
0
votes
2answers
43 views

Cluster quality internal validity after PCA

Last week I asked: Compare clusters quality (internal validity) after and before dimensionality reduction by PCA I've been trying to calculate internal validity for clusters after PCA using the iris ...
1
vote
1answer
17 views

coefficient multiple logistic regression flips sign when adding second predictor [duplicate]

I have a binary outcome variable (word not learned = 0; word learned = 1) and two continuous predictors: how many phonemes/sounds the word contains (phonemic length) phonotactic probability (average ...
1
vote
0answers
39 views

Input data for Canonical Correspondence Analysis (CCA)

I'm going to conduct Canonical Correspondence Analysis (CCA). In the tutorial I've found at: CCA environmental data are discrete ...