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`.

learn more… | top users | synonyms

0
votes
0answers
2 views

Interpreting ACF and PACF Plot

My raw data consists of a 60-day time series with a downward trend. The data is weekly so the frequency is set to 7. I calculated the difference of the data which looks like this When I run ACF ...
0
votes
0answers
2 views

deltaGAM - residuals vs predictor variables

I am wondering if anyone would be able to help me with the deltaGAM method - using a binomial model to predict probability of occurrence, a multinomial model to predict non-zero abundance, and then ...
0
votes
0answers
5 views

Is dunn.test a suitable alternative to kruskalmc in pgirmess package?

I'm trying to run the krushkalmc method after running kruskal.test as part of my analysis with the Kruskal-Wallis rank sum test. I have data with a small sample size that also does not have a normal ...
0
votes
0answers
12 views

map pca eigenvalues to original matrix' columns

I am unsure if this questions is valid mathematically speaking, but I am wondering if it is possible to map the eigenvalues that prcomp returns with the original columns... meaning... if my matrix if ...
2
votes
1answer
19 views

R: how to do statistical inference on multiple dependent and independent variables?

In the past I've run separate multiple regression models for many correlated independent variables and one dependent variable. For this I've been using the R package multtest ...
0
votes
0answers
8 views

Document classification with very few documents

I wanted to know if there is any method in state of art that deals with document classification methods with very few training samples in R. I have just 20 documents and need to classify them into 3 ...
0
votes
0answers
33 views

lm and nls F test in R

I am trying to compare a linear model and other non linear models(Asymptotic, Logistic and Ricker) by means of an F test or a likelihood ratio test. I have tried anova(Linear, Logistic,Ricker, ...
1
vote
1answer
10 views

In cross validation, higher the value of k, lesser the training data for this formula?

Is it right to say that smaller the value of k in cross validation based on the following formula, more the number of records in test data/smaller the number of records in training data. According to ...
0
votes
0answers
19 views

Logistic glm: marginal predicted probabilities and log-odds coefficients support different hypotheses

I'm running a fixed effects logistic regression in R. The model consists of a binary outcome and two binary predictors, with no interaction term. On the log-odds scale, and as an odds-ratio, the ...
0
votes
0answers
4 views

How to get subgroup-wise summary over a vector? [migrated]

I know how to solve that in a c-style for-loop method, but I just want to figure out how to solve it in R-mindset---the functional programming paradigm. Say, ...
1
vote
0answers
22 views

Cointegration ratio using R for pair trading [on hold]

I am hoping to do pair trading using R. To do that, I have to calculate the cointegration ratio between the two stocks. How can I obtain this cointegration ratio using R? For example, I am going do a ...
0
votes
0answers
2 views

Including uncertainty in covariate using R2openBUGS [migrated]

I am trying to run a basic logistic regression model in BUGS using R2openBUGS. I have run this code using R2jags with success but want to do this in BUGS as I would like to explore using spatially ...
1
vote
1answer
17 views

Comparing two means using permutation test and bootstrapping with the boot() function in R

I would like to know how to do a permutation test using the boot function in R. The goal is to compare means of two groups of people: some of them drink beer and the other one drink water. The ...
0
votes
0answers
8 views

R: How do I print string quote and variable by concatenation? [on hold]

I am trying to do a simple print statement in R. print("correlation: " + cor(data$Height, data$Weight)) But I get an error "non-numeric argument to binary ...
0
votes
0answers
10 views

R tsoutliers data error

I am getting an error that says "trying to get slot "y" from an object of a basic class ("numeric") with no slots" When I do auto.arima, it works fine, but when I apply the function on the same ...
0
votes
1answer
16 views

Time Series Hold Out Data not used to build model

It is my understanding that if one wants to build multiple time series models on a time series that goes from 2000 to today (2015) monthly; and one wanted to use that information to forecast 3 months ...
0
votes
0answers
11 views

Dividing a map by electoral result with R? [on hold]

I would like to divide a map of Germany vertically by the electoral results of 2013: ...
0
votes
0answers
7 views

reaching max.print on R [migrated]

I just found a bunch of weather data that I would like to play around with in glmnet in R. First I've been reading and organizing the data in R, and right now I am just trying to look at the raw data ...
1
vote
0answers
7 views

Unsupervised Clustering using randomForest

Outline of clustering technique using Random Forest A synthetic data is created by randomly sampling from the data of interest. It is used as the base line to measure the "structureness" or ...
0
votes
0answers
16 views

How can I run ordered logistic regression on a large sparse matrix in R

I have a sparse matrix X, 970283x9511, with 970283 documents and 9511 features. I have a vector y of length 970283 corresponding to a rating 1-5. I know of the glmnet package, which has binomial and ...
2
votes
0answers
20 views

Nagelkerke $R^2$ interpretation

I used logistic regression and found that my model fits well: ...
1
vote
0answers
26 views

Time Series using STS( Basic Structural Model)

I am using Basic Structs to forecast my time series. My forecast is exactly overlapping my data. I am sure no model can predict with 100% accuracy. I know I am missing something, can someone point me ...
0
votes
0answers
4 views

Error in Coocur matrix: 'x' must be numeric [migrated]

I am trying to determine species co-occurrence using cooccur package in R. My data appears to be formatted just like the example data, finches, except I keep getting a "non numeric" error when I run ...
0
votes
0answers
21 views

Assignment Problem — Constraint matrix setup

I struggle with an assignment problem. This question and @TAS answer helped me a lot, but I still have problems with the constraint matrix for my specific situation: Assign 159 workers to 11 jobs ...
0
votes
1answer
25 views

Single column plot in r versus gnuplot [on hold]

I am new to R environment. I have created a simple data set as shown below. 1 2 3 7 8 9 I simply plotted this data using both gnuplot and R. Command ...
0
votes
0answers
9 views

Different coefficients of linear discriminants with the same raw data

I have just tried two ways to perform a linear discriminant analysis. Mode 1 This is the data, divided in two tables (printed from screen using R commander): They belong respectively to the two ...
0
votes
0answers
16 views

Maximum likelihood estimation of the log-normal distribution using R [migrated]

I'm trying to estimate a linear model with a log-normal distributed error term. I already have working code for a linear model with normally distributed errors: ...
2
votes
0answers
24 views

Mahalanobis Distance - Geometric Place

Given a matrix $\mathbb{X}$ of 20 elements, representing 20 observation of a 5-variable normal, I was asked to find the Sample Mean Vector and Sample variance matrix and to find the geometric place of ...
0
votes
0answers
16 views

R how to pass a (potentially) missing argument? [migrated]

I have in R a low level function that uses the missing() construct, and would like to use a high-level/wrapper that passes some arguments to it. The problem is that even if the user does not provide ...
0
votes
0answers
15 views

How to use R to get drift rate and volatility rate of stock prices changes?

I am doing a research on the historical annual stock prices changes, where I have about 30 rows of annual stock prices. How can I use R to get the drift and volatility rate?
1
vote
1answer
18 views

Translate glmer (lme4) model specification into MCMCglmm

I am having some computational trouble estimating the following model with the glmer function in lme4: ...
0
votes
0answers
6 views

R's nnet needs decay to perform with sin() like function, why variant reproducibility

I've noticed that for sin() like data, I need to use "decay" which is available in nnet to get the ANN to perform. Why would that be in theory? Also when I run runNN(0.02) over and over, sometimes ...
0
votes
0answers
11 views

Optimize deep learning model in h2o with R [on hold]

I created a deep learning model with h2o in R. But it still has very poor performance. How can I optimise the outcome? What parameters can I how change? Is it just randomly changing parameters and see ...
0
votes
0answers
12 views
0
votes
0answers
8 views

Creating a readable matrix with a netCDF file

I'm still learning R and I'm having trouble getting R to read and organize data in a way for me to perform analysis on. I have taken data from a free online weather database here: ...
0
votes
0answers
11 views

Testing Various Hypothesis Test for Coefficients in R [migrated]

I Know in R it returns for a Multiple Regression it returns hypothesis test for $\beta_i=0$ but what if you want to test such tests like $\beta_i=1$. Is there any easy command for this or if not how ...
0
votes
1answer
44 views

P value of multiple linear regression

I have extremely large number of observations (8524152) of soil moisture, precipitation, evapotranspiration, delta precipitation, and delta evapotranspiration. I ran a multiple linear regression model ...
2
votes
1answer
54 views

Why is the p-value for Cohen's $d$ not equal to the p-value of a t-test?

I am using the package compute.es in R to calculate effect size from a $t$-test. The $t$-test is marginally significant with $p=0.05657$. When I run ...
0
votes
1answer
16 views

Model comparison between glm (with Firth correction), random Forest, penalised SVM

I am currently developing three models to classify features of gene sites. I was using glm (with Firth correction), random Forest and SVM to build the models and I used forward and backward ...
1
vote
2answers
37 views

Feature selection before neural network classification

I have a training set of 87 samples and 9480 variables. My predictors are continuous and my response variable is binary. I'd like to use the caret package in R to tune a neural network classification ...
2
votes
1answer
21 views

R Lasso regression for numeric outcome

I do not have experience of using LASSO regression glmnet. I wanted to use it to see which factors affect most my attribute. I have 99 factors (binomial) that affect one attribute (numeric). Is it ...
0
votes
0answers
23 views

How would you categorise a matrix into high and low levels? [on hold]

I have a matrix of data consisting of over 30000 rows and 2000 columns. My rows are different samples and my columns are different conditions that those samples were measured. I want to assign the ...
3
votes
0answers
19 views

Quasipoisson or negative binomial glmm with differing dispersion by group

I have a set of count data, which look something like this: ...
3
votes
1answer
16 views

Determine if there is a difference between two large vectors of different sizes of non-normal quantiative data in R

I have two vectors that are of unequal sizes. They contain quantitative data that does not form a normal distribution. I would like to see whether or not they are statistically different. Is there a ...
0
votes
0answers
22 views

Frailty term interpretation for coxme function [on hold]

How do you interpret the frailty terms that are outputted with the coxme function in R when using random effects? coxme(Surv(time=icu_los, event=censor)~ (1|site), data) I would like to make a ...
1
vote
0answers
23 views

What is best practise for dimensionality reduction in rows of data

I was wondering what was best practise for dimensionality reduction in observations (as opposed to features) in a data-set? I often have data comprising of a multiple, random number of observations ...
0
votes
0answers
5 views

Regression Model for Matched Continency Tables Coefficient Interpretation

Sorry to insist. A number of questions in the same direction (coefficient interpretation) by different contributors, never answered. ...
0
votes
0answers
24 views

R: How to define a distribution using CDF [on hold]

I want to use "ks.test()" to compare my data to a specific distribution defined by CDF, which to my understanding is possible. But, being new to R, I am having trouble trying to find the way to define ...
0
votes
0answers
7 views

Iterative Differential Expression Analysis for Multiple Categories

I have a dataset which consists of one categorical variable and many numerical variables. This is how my data is formatted: ...
0
votes
1answer
32 views

What transformation should be carried out if the count is non-integer in poisson glm in r?

My data is like this: person final sex 1 34.20 1 2 2.00 0 3 15.58 0 4 18.00 1 5 50.06 1 I am fitting ...