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
4
votes
2answers
503 views

auto.arima vs corARMA: AR coefficient greater than 1

Using R and the nlme package, I tried to fit a gls model with a corARMA correlation ...
4
votes
1answer
311 views

Quasi-poisson for underdispersed data

Related to glm() in R, I saw a few post recommending modeling underdispersed data using the Conway–Maxwell–Poisson distribution, specifically with the R package <...
2
votes
1answer
40 views

Probability of multiple parasites given the presence of one parasite

I am trying to simulate parasitic plants that infect trees. I would like to test wether the presence of one parasite makes it more likely that the tree has more than one parasite. The number of trees ...
-1
votes
0answers
8 views

Compiling reports from R scripts

I would like to create reports (pdfs, html files) from .R files. This is possible given the following page:Compiling Reports from R Scripts (...
3
votes
1answer
3k views

How to compare proportions across different groups with varying population sizes?

I am trying to understand what statistical measures I can use to compare three groups having varying populations to understand which group is bad (highest probability of death or most vulnerable or ...
0
votes
1answer
56 views

How high variance effects differential gene expression analysis

I was wondering if anyone had any advice on comparing two groups where the variance in once group is high and the variance in the other group is low. Specifically, I am attempting differential gene ...
1
vote
0answers
20 views

linear mixed effects models - overfit: how to calculate predicted R squared

I am using R to build the random structure of my model but I am ending up with a very complex model. Currently looks like this: ...
1
vote
1answer
213 views

Using binary factors as predictor variables in piecewiseSEM in R

I am looking for help with the use of categorical binary predictor variables in the piecewiseSEM package in R. I am inspecting the effect of two categorical variables on one continuous response ...
2
votes
1answer
28 views

Interpret survival curve for multiple-event Cox proportional hazard model

I am using the bladder2 dataset, which is setup in "conditional" long format: ...
45
votes
3answers
56k views

What is Deviance? (specifically in CART/rpart)

What is "Deviance," how is it calculated, and what are its uses in different fields in statistics? In particular, I'm personally interested in its uses in CART (and its implementation in rpart in R). ...
0
votes
0answers
10 views

SVR feature selection

I'm trying to go through feature selection with SVR (trough caret package in R). Working on a dataset with 400+ points and 20+ features and 2 target variable. Can I use correlation coefficient for ...
1
vote
0answers
21 views

adjusted R-squared

Does anyone know how to calculate the adjusted R-squared for mixed effects models in R? Also, when two models give you a very similar adjusted R-squared, what criteria do you normally use for model ...
0
votes
1answer
137 views

Full effects from Poisson GLM

I am running a Poisson GLM with count data as response variable and both continuous and categorical variables as predictors. I made use of the following (dispersion is OK): ...
0
votes
2answers
137 views

graph classification task - multi label?

I have a data set in graph format representing semantic connection between terms. The data set is divided into clusters, each with several labels (not unique, or mutually exclusive, no set number of ...
0
votes
1answer
605 views

What does variables in learned model by nnetar function from forecast package in R stands for? [on hold]

I get the following model from nnetar function on my time series data: Series: ts_abc Model: NNAR(4,1,3) Call: nnetar(x = ts_abc) Average of 20 networks, each of which is a 5-3-1 ...
0
votes
0answers
6 views

Determine the appropriate window size to scale the original point pattern [on hold]

I am new to the spatial statistics using R. I have a large point pattern, and I would like to apply model fitting to the local point pattern instead of the whole pattern. To do so, I need to ...
0
votes
0answers
13 views

Permutation of treatment and control groups in R program [migrated]

I would like to do blocked randomization for 120 participants into 40 blocks of 3 participants each. 2 participants within each block is assigned to treatment (denoted by 1) and 1 participant is ...
1
vote
1answer
17 views

Test significance of weighted average of multiple regression coefficients from different models

I have 3000 independent samples (customers) where I fit a regression model to each sample and estimate regression coefficient of interest, $B_1{_i}$ from the following model $Y{_i} = B_0{_i} + X_1{_i}...
0
votes
0answers
22 views

Using NbClust on datasets that sometimes produce negative eigenvalues. When to exclude data, when to force to zero, when to exclude test index?

Background on why I am using clustering: I am analyzing data from a multistep biological experiment, where each step is done in batches of varying sizes. I want to account for any biases that might ...
0
votes
0answers
18 views

LInear Regression - approaching models with Date as variable

This question is an extension to an earlier question Linear regression - date as dummy variable. I still have some doubts in selecting the best modeling approach. Autoregressive would be better, ...
3
votes
1answer
668 views

find repeated measure correlation coefficient using linear mixed model

I'm using Orange dataset to illustrate my question. In this dataset, for each tree, the circumference and age were measured several times. Say we need to find the correlation coefficient between tree ...
1
vote
1answer
640 views

ANOVA for non-normal, heteroskedastic response

I have a network data set on which I am running product diffusion simulations. I have three factors - A (10 levels), B (10 levels) and C (2 levels) producing 200 factor level combinations. For each ...
0
votes
0answers
16 views

two sample z test in r

I am dealing with a dataset like this below ...
0
votes
0answers
10 views

How do i specify loss function in rpart r? [on hold]

I want to customize the loss function in rpart function from rpart package in r. Any solution would be appreciated, thanks
0
votes
0answers
14 views

Backtesting GARCH model in R

I used garch to predict the volatility of shopify(SHOP.TO) . I used ugarchroll to backtest my GARCH model but my mean absolute percentage error was incredibly high: ...
1
vote
1answer
139 views

Bootstrap ADF Test

I'm interested into the application of bootstrapping for the case of smaller data sets. I tried following reproducible script to compare the results of a "normal" ADF test with a "bootstrapped" test. ...
0
votes
1answer
30 views

Significance of intercept only in Logistic Regression analysis

Having performanced a logistic regression in R with the glm function, I'm not sure how to interpret the results for the Intercept (as shown below). So I found that my intercept is significant but all ...
0
votes
1answer
137 views

Calculating odds ratio for quasibinomial glm

I have a quasibinomial glm and I'd like to get odds ratios for each of the predictors. Is it acceptable to use the 'oddsratio' package in R in the same method that you would for a binomial model (e.g. ...
41
votes
4answers
7k views

OpenBugs vs. JAGS

I am about to try out a BUGS style environment for estimating Bayesian models. Are there any important advantages to consider in choosing between OpenBugs or JAGS? Is one likely to replace the other ...
1
vote
1answer
522 views

Non linear effects in Poisson regression via splines

I have fitted this model in Poisson regression, and I need to check for possible non linear effect of age using splines, in R. Can you please help me with the code? ...
3
votes
2answers
65 views

Why am I getting a different intercept in my regression model with categorical variables when I let them interact?

I'm comparing two regression models in R. Both use the same categorical variables the only difference is that in one I allow them to interact, the other I don't. ...
1
vote
1answer
216 views

Randomly generating transition probabilities for Markov chains

I'm trying to simulate a person moving through a household using a Markov chain. Each state would be a room in the house. The issue I'm running into is that I have no existing data telling me what a ...
0
votes
1answer
636 views

Interpreting Median Survival vs Median in survival data

I'm doing some survival analysis in R using the survival package for a patient cohort. When making a Kaplan-Meier curve using survfit, it reports a median survival time. However this value is very ...
0
votes
1answer
50 views

Detecting the outliers from scatter plot

I am trying to understand this question from Everitt et al. (A Handbook of Statistical Analyses Using R) which asks, "Collett (2003) argues that two outliers need to be removed from the plasma data. ...
3
votes
1answer
3k views

NA in glm model

I have the data here.But When I tried to build the logistic regression model using glm function its shows NA in TotalVisits. I have found similar question on stack overflow but that is answered for ...
-1
votes
0answers
9 views

R scale data back to their original range of values [on hold]

I have the following reproducible data: MyScaledData contains scaled values between 0 and 1 for 6 variables. minvec and ...
1
vote
1answer
1k views

TMM-normalization of RNA-seq data in R language using edgeR package

My data is in a numeric matrix of RNA-seq data from Illumina 2000 platform (with proper alignment and other preprocessing done), where columns represent subjects, and rows represent raw expression ...
1
vote
2answers
140 views

using training data in final model output

I have customer data for around 400,000 customers where 270,000 of them are current customers and 130,000 of them are past customers who churned, what I am doing is classifying them as 0 (non-churn) ...
0
votes
0answers
31 views

How to test for differences in gradient between time-series

I have time-series data where I've generated measurements of the same variable using different techniques, for a group of samples. An example of my data looks like this: ...
0
votes
0answers
13 views

R: Attribute Overepresentation in a cluster

I performed hierarchical clustering in a dataset with 4 categorical variables (2 nominal, 2 ordinal) in R using hclust and daisy ...
0
votes
1answer
24 views

Example of rejected alternative hypothesis of a Wilcoxon rank sum test?

I've recently looked into the Wilcoxon Rank Sum test for comparing groups of continuous values. In particular I've been using R's wilcox.test() function for this ...
1
vote
1answer
6k views

K-Nearest Neighbor imputation explanation

I have a dataframe with some missing data in it. I need to deal with those missing data before trying anything. I've seen that knnImputation in R is a good ...
1
vote
1answer
566 views

Kmeans clustering results on pca dataset reduction

Background: I have a set of 321 observations of 18 correlated variables, so I do PCA to extract a low dimensional set of features from this high dimensional data set. I select 9 of 18 components(the ...
0
votes
0answers
22 views

gene differential expression with R [on hold]

I'm trying to find out if a gene is differential expressed. A extract of the data is in my code below. ...
1
vote
1answer
44 views

What do ellipses of PCA analysis (factoextra) mean?

Biological question: do plants that have been attacked by insects differ in their characteristics from plants that have not been attacked by insects? Data frame includes six numerical variables ...
0
votes
1answer
98 views

How to determine the significance between females and males participants in a group?

I have a group called smoking status of males and females. From 500 candidates, 120 females and 130 males smoke. What statistical test should I use to figure out if the number of smokers significantly ...
0
votes
1answer
16 views

Confirmatory structural equation modelling to test predicted strengths of relationships?

I have two implicit measures (impl. attitude towards high-cal food and alcohol) and two explicit measures (high-cal food consumption and alcohol consumption). I want to confirm that my implicit ...
0
votes
0answers
31 views

Is the poisson regression model the best method for my data?

I'm trying to understand if restrictive firearm legislation and socioeconomic characteristics influence the movement of illicit firearms between states in the US (ATF Trace Data, 2012-2017; RAND State ...
0
votes
1answer
135 views

One side tests for example monte carlo

I looked at R for Spatial Statistics (spatstat) and I actually found out that it doesn't always have to be that below -1.96 is necessarily clustered and that above 1.96 must be uniformed. There is ...
2
votes
2answers
69 views

How to partially compress domain of a scatter plot?

I am not sure where should I place this question. It is a more general question. My question is: I have scatter plot with 1 million points. I am using R to plot my data. When I plot my data points, ...