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

ggvis line chart with interactive x axis range [migrated]

I'd like to be able to Plot a line chart in ggvis Add two interactive controls, which allow me to set the min and max x values on the chart This sounds pretty straightforward - my code is: ...
0
votes
1answer
18 views

Standard deviation of residuals from a linear regression

I've ran this linear regression: mtcars_lm <- lm(mpg ~ wt, mtcars) Lets say I observe a value of mpg that is 2 above the ...
0
votes
2answers
14 views

Test for effect of groups in a mixed effects model

This model is a simple linear regression: mtcars_lm <- lm(mpg ~ wt, mtcars) And this model adds cyl as a random effect: ...
0
votes
0answers
9 views

How should I use GAMLSS package in R? [on hold]

I have used linear regression techniques, but I now want to use the GAMLSS package. I have a few general questions: How do I find out which distribution is best for my data? Please point out ...
0
votes
0answers
32 views

Scalable code in R [on hold]

In the following code I call prop.model() in an outer loop 20000 times. And as can be seen, in each prop.model() call, I need to call comp.inf() 1000 times. I am using foreach for parallelization, ...
0
votes
0answers
19 views

Logistic regression for sparse data in R

How to perform a logistic regression and/or SVM on sparse data in R? I have $ 10^6 $ observations, $ 10^4 $ TRUE/FALSE features, and the data is sparse, i.e. ...
0
votes
0answers
8 views

hypothesis of unique elasticity in mlogit()

I am trying to run a nested logit model using mlogit() in R. There is an option un.nest.el, which is "a boolean, if TRUE, the hypothesis of unique elasticity is imposed for nested logit models" (from ...
0
votes
1answer
14 views

Complex level 1 variance mixed effects models in R

Take this mixed effects model in R: $y_i = \beta_0 + \beta_1X_{ij} + u_{j} + e_{ij}$ where $u$ is a random effect (level 2 residual) with groups $j$. It is possible to allow the variance of $e_{ij}$ ...
0
votes
0answers
23 views

How to do centroid clustering of sequences?

I want to cluster sequences using centroids. In the hclust package it is noted that "Method "centroid" is typically meant to be used with squared Euclidean ...
0
votes
1answer
41 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
38 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
11 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
73 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 ...
3
votes
2answers
67 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
41 views

what is the Probability of selecting 10 SNPs from a list of 5000 SNPs simply by chance

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
21 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
35 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
8 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
15 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
46 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
14 views

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

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

R - Lagged x-variables in ARIMAX [closed]

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
196 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 [closed]

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
45 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
89 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
43 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? [closed]

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
43 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
60 views

How to remove the outliers from a dataset? [closed]

I have a dataset containing noise points. How can I remove lower and upper 1% data points using R?
3
votes
0answers
44 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
18 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
52 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 ...