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 program in `R`.

learn more… | top users | synonyms

0
votes
0answers
1 views

How should I inteprete this anova result?

I sas this example in the book R in action, the codes in R are as follows: ...
0
votes
0answers
5 views

Rolling window in time (t) to compute forecasting [migrated]

I want predict using Recursive Method. Each month (t) i need to roll my data window regarding the last month, one month ahead (t+1) ...
0
votes
1answer
16 views

How do I interpret the variance of random effect in a generalized linear mixed model

In a logistic Generalized Linear Mixed Model (family = binomial), I don't know how to interpret the random effects variance: ...
0
votes
0answers
8 views

R: How to predict the class after model has been created?

I have created a model for my data by the following code: ...
1
vote
1answer
63 views

How can I plot this graph in R? [on hold]

I'm reading "An Introduction to Statistical Learning" and noticed the following plot made in the book for a regression tree: I'm trying to make a similar plot for my dataset but can't figure out ...
1
vote
0answers
18 views

What does “Virgin Data” mean?

I am using RTextTools, which has a function to create container with following syntax: create_container(matrix, labels, trainSize=NULL, testSize=NULL, virgin) ...
0
votes
0answers
29 views

what is the Probability of selecting 10 SNPs from a list of 5000 SNPs simply by chance [on hold]

We conducted a study to predict deleterious mutations from a list of around 5000 mutations (which contains both neutral and deleterious mutations; the real state of each mutation is unknown), using ...
0
votes
0answers
8 views

R's parallel Foreach slow to start with a high iterator value. What can be done? [migrated]

On a windows platform it seems that a high iterator value will stop foreach in its tracks. For example ...
1
vote
0answers
16 views

If peak was higher than normal, why does updated arima model overestimate activity in remaining time series?

I have a number of time series with strong seasonality and I am using auto.arima() from R's Forecast package along with Fourier and dummy/explanatory variables to address the seasonality to make ...
0
votes
0answers
19 views

Convert columns to objects in R [on hold]

I am (clearly) a beginner, but I am having difficulty creating objects in R. I imported my excel file via gdata and that seemed to work fine. When I listed the data in a table everything was there. ...
0
votes
0answers
18 views

Meta-analysis with a categorical explanatory variable

I am attempting to fit a model to my data for meta-analysis I'm working on. The data is structured as follows: ...
0
votes
0answers
4 views

empirical t-values with bootsempls in R, transform console output to vector [migrated]

If I run bootsempls() function of the semPLS package in R, I get an object of class "bootsempls", "boot", lets name the object "mymodel_boot". If I run ...
0
votes
0answers
4 views

Plot response variable against all explanatory variable in a single graph ggplot2 [migrated]

Let us say that we have 4 explanatory variables x1, x2, x3, ...
0
votes
0answers
7 views

Function that returns a function in R [migrated]

I'm trying to create a function that creates and returns a new function. I've tried the following, but it doesn't work. I want ...
0
votes
0answers
17 views

ARIMA estimate validation through arima.sim

This is out of my curiosity trying to compare time series input to an ARMA model and reconstructed series after an ARMA estimate is obtained. These are the steps I am thinking: Construct simulation ...
0
votes
1answer
29 views

step {stats} is too slow. Are there multicore solutions?

I am finding that trying to do a stepwise logistic regression is far too slow on my data set (6 hours). Is anyone aware of any faster solutions out there? Perhaps one that takes advantage of the ...
0
votes
0answers
7 views

How to avoid error using ltm::grm? [on hold]

I am getting an error doing grm from the package ltm. It's odd because usually grm performs ...
1
vote
0answers
12 views

Fitting a linear model with few extreme values

I want to estimate a parameter (let's call it x) by some other paramaters via some linear model. Usually I take lm() in R for such purposes. However, in my situation the parameter x is mostly very ...
1
vote
0answers
39 views

Bootstrapping confidence intervals in R [on hold]

I am a total beginner in using the bootstrap method... At first I calculated the 95% confidence interval myself using R but it is not normally distributed so this would only be a veery rough ...
0
votes
0answers
13 views

logistic regression with plsRglm [migrated]

I am using plsRglm package to run logistic regression, and met two major problems as below. My $X$ variables includes factor variables, such as immigrant status ...
0
votes
0answers
23 views

Random forest score in R [migrated]

From sklearn import ensemble: clf = ensemble.RandomForestClassifier(n_estimators=150) clf.fit (X_train, y_train) clf.score (X_test, y_test) 0.83208955223880599 ...
0
votes
0answers
14 views

Using R : linear model (lm) - Fixed Effect Model - Vary intercept by different factor than the coefficient

I am having a problem setting up a panel data model (Fixed Effects) At the moment I am running the following code: ...
0
votes
0answers
17 views

Converting S-Plus Design package to R RMS package [migrated]

I am inheriting some code from S+ that fits a Cox Proportional Hazard model with imputed data. It then uses the Design package to get predicted values and confidence intervals. ...
1
vote
1answer
43 views

Can't reproduce results using foreach and RSNNS

I'm trying to train multiple Multi-Layer-Perceptrons using foreach and mlp(...) from the RSNNS package. As I ran into problems reproducing the results generated by mlp() and foreach in a parallel ...
-1
votes
0answers
12 views

Recommenderlab - Order evaluation results (list of lists?) [on hold]

I'm trying to evaluate the results of several recommendation methods from recommendationlab package, and get an ordered list(or data.frame ) by the MAE. I've tried several methods but none of them ...
0
votes
0answers
16 views

R - Lagged x-variables in ARIMAX [on hold]

I'm trying to fit a ARIMAX model in R on the form: $$y_{t}=a+b \times y_{t-1}+c \times y_{t-2}+d \times x_{t}+e \times x_{t-1}+error$$ Unfortunately it seems like you cannot lag variables in the ...
5
votes
2answers
193 views

Plotting distributions of variables across time

I have two datasets in the form of $q \times k$ matrices (variables $x$ and $y$). Both variables differ (lets assume that they differ by a constant). Columns of the matrices are subsequent points in ...
0
votes
0answers
16 views

Scatterplot with edgeR DESeq Voom [on hold]

I am new in RNAseq and I started using edgeR, DESeq and Voom from Limma package to do differential analysis. I have a data frame of 30 couples of Normal and Tumoral tissues Since each method is ...
1
vote
0answers
18 views

In R, generating every possible integral solution to a set of constraints [migrated]

In R, I’m trying to generate an array of all feasible integral solutions to a set of equality and inequality constraints. As an example consider the model: Model = a^2+b^2+c^2+d^2 Where: ...
0
votes
1answer
43 views

Resources for learning R with Statistics [duplicate]

Already read: Resources for learning R I would prefer to have a textbook which covers statistics with R, accessible to a beginning graduate student in statistics. Since I'm not as familiar with R as ...
3
votes
3answers
87 views

glm in R - which pvalue represents the goodness of fit of entire model?

I am running glms in R (generalised linear models). I thought I knew pvalues - until I saw that calling up a summary for a glm does not give you an overriding pvalue representative of the model as a ...
0
votes
1answer
42 views

glm in R - is the pvalue for Intercept important? Which pvalue represents the goodness of fit of entire model?

I am running glms in R (generalised linear models). I thought I knew pvalues - until I saw that calling up a summary for a glm does not give you an overriding pvalue representative of the model as a ...
-1
votes
0answers
25 views

How to use gpu in R in Windows 7? [on hold]

As I know, there are packages (like gputools, magma, HiPLARM, ...) for unix OS. Is it possible to use something like gputools in Windows 7? thanks!
-2
votes
0answers
24 views

How to calculate relative risk in R Studio? [migrated]

How to calculate relative risk in R Studio? In input i have names(DS) Tab<-table(DS[,5],DS[,11],DS[,3]) No Yes No 4 16 Yes 40 168 I am new in ...
0
votes
0answers
42 views

Generate correlated continuous and categorical data in R

Task at hand: generate a simulated dataset containing both continuous and categorical variables, given a pre-defined correlation matrix. What has been done: this post covers how to generate ...
2
votes
1answer
26 views

Predicting the direction of moving a object in R

I am trying to produce a model that classify the direction of a moving object. In the figure we see a single projection of 3D space where an object was moved up and down (red) vs up and down together ...
1
vote
2answers
57 views

How to remove the outliers from a dataset? [on hold]

I have a dataset containing noise points. How can I remove lower and upper 1% data points using R?
3
votes
0answers
41 views

Fitting a glm to a zero inflated positive continuous response

I'm trying to fit R glm's to data sets where the response is zero inflated positive continuous. This is an example data set ...
0
votes
0answers
16 views

Machine learning algorithms for panel data

In this question - Is there a method for constructing decision trees that takes account of structured/hierarchical/multilevel predictors? - they mention a panel data method for trees. Are there ...
1
vote
1answer
51 views

SVM RBF performance on “dissimilar” data

I've been studying the performance of machine learning algorithms on "dissimilar" data (that is, prediction on new data that are not that "similar" to the training set) and I came up with this ...
1
vote
0answers
18 views

Generalized additive mixed model in R - specifying a fit function

The data in question comprise two response groups (no response vs. stress signal), different individuals, repeated measures ...
0
votes
0answers
6 views

Errorbars for barplot only in one direction in ggplot2 (R)? [migrated]

Is it possible to adjust errorbars in ggplot2 so that they are plotted only in one direction (e.g. only upwards but not downwards)? ...
0
votes
1answer
13 views

How to test a time series' serial correlation with ties in R?

I was trying to test serial correlation for a time series measurements (x1,x2,...xn). The problem is that some of them happens in the same date, the time points are ...
0
votes
0answers
30 views

Bootstrapped BCa confidence interval of median (R package simpleboot) does not correspond with Wilcox.test p value

I am using R to compare the medians of two groups. Each individual has received a score of between 0 and 100. Both distributions are very skewed. The median of group A (n=33) is 87.8 (IQR 75.1, 100.0) ...
0
votes
0answers
11 views

Meta analysis on multiple endpoints and unknown covariance

I am doing meta-analysis on intervention studies on human subjects where a number of measures were obtained before and after the intervention in a treatment and a control group. We categorize the ...
0
votes
0answers
28 views

modelling season in function of temperature and precipitation: which model to use? [closed]

I have to model the 4 seasons on basis of temperature and precipitation. I have no idea which model to use. I'm a new R user and I've used only linear model and logistic regression till now. Is there ...
4
votes
1answer
31 views

Best practice for ADF/KPSS unit root testing sequence?

I've been quite confused by the various unit root testing strategies recommended in the literature, so I was hoping others may have some advice on the best way to proceed using ADF and KPSS tests. ...
1
vote
0answers
12 views

Approaches to high dimension pattern matching problem [migrated]

My apologies in advance as I am new to this. I have searched the internet and tried various processes and nothing seems to work or address this situation. I have a dataset of 30,000 transactions and ...
2
votes
0answers
18 views

How to estimate the percent of the variation of a time series explained by another time series (non-stationary)?

I've been learning about time series analysis because I want to understand how much groundwater level changes in an aquifer affect land subsidence (land sinking). I have two time series: (1) ...
0
votes
0answers
9 views

How to make all interactions in R before using glmnet [migrated]

I have an x-matrix of 8 columns. I want to run glmnet to do a lasso regression. I know I need to call: glmnet(x, y, family = "binomial", ...). However, how do I get x to consider all one way ...