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

Clustering and differentially expressed genes in RNAseq

I have performed differential analysis with DESeq2, edgeR and voom-limma. My goal was to evaluate each methods on my data. Now I would like to perform clustering with the genes found differentially ...
0
votes
0answers
6 views

Plot individual(longitudinal ) trajectories of an lme model using nlme

I have a dataset with id, time(continious) and DFG. ...
7
votes
2answers
427 views

Is every ARIMA(1,1,0) model equivalent to an AR(2) model?

Assume I have a time series $ x_t $ that I want to fit using an ARIMA(1,1,0) model of the form: $ \Delta x_t = \alpha \Delta x_{t-1} + w_t $ This could be rewritten as: $ x_t - x_{t-1} = ...
1
vote
1answer
24 views

Rolling Forecast Re-training Step Concept

I'm trying to understand the steps in Rob Hyndman's Multi-step forecasts without re-estimation example below. I'm wondering what the purpose is of ...
0
votes
0answers
16 views

Obtaining RSS from R strucchange package [migrated]

I'm trying to search for unknown structural breaks in co-integrated time series. $$Y_t = c_t + \beta X_t + e_t$$ Searching for breaks in this context is essentially the same as it would if both ...
0
votes
0answers
45 views

Bayesian Time Series model in R

Similar to the scenario described in this paper, I need to forecast a seasonal time series with only a few periods. I am working with about 2 years of daily revenue data, and I want to forecast the ...
0
votes
1answer
58 views

Noob Data Design Question - 1 on 1 competition

My question is about how to best structure my dataset for a competition between 2 players of a game (for the purposes of prediction of future game winners). There will potentially be hundreds of ...
0
votes
0answers
9 views

timeseries forecasting when datapoints doesn't start at same time period

I have a dataset which has lifecycle information of different products but all the products doesn't start selling in same period or same year/quarter.In this case how should i do time series modelling ...
1
vote
1answer
18 views

how to check if model built is valid or outdated for new data

If i have a classification or clustering model built for retail customers till last year.How do i check if my model is still valid to this year's data? We can check accuracy of model to new data but ...
0
votes
0answers
13 views

handling dataset if some columns have sparse data

1)if in a dataset 8 columns and of them 3 columns have sparse data[lots of missing values].can anyone tell me what are the general practices followed to transform this data before modelling. I know we ...
0
votes
0answers
6 views

How to use php-r [migrated]

I want to use R inside php using php-r. As I am very new to PHP, I would be very grateful if anyone guides me on how to install php-r inside xampp and run the same. I tried putting the PHPR ...
1
vote
1answer
79 views

Independence of two categorical variables & chi-square

I have data as follows: ...
0
votes
0answers
8 views

Save priors in rjags [migrated]

I'm running a bayesian model in rjags, and I would like to be able to output a plot of the trace of the MCMC, the posterior distribution for my parameters (which I can already obtain from coda), and a ...
0
votes
0answers
10 views

K-NN Binary classification with boolean features

inexperienced forum user and ML 'user'. I'm trying to shed some light on some data. The feature vector is all booleans (isMale, isAmerican, hasMac etc..) and it is a binary classification problem. ...
0
votes
1answer
31 views

Which R statistics tests to use in order to compare the effects of different variables on a test score

cross posted from StackOverflow I'm hoping someone can help point me in the right direction. I've got a data set which includes 'testscore', 'User Type (a or b)', 'Gender' and 'Age Group'. The data ...
3
votes
0answers
84 views

Am I calculating the Anderson-Darling statistic correctly for comparing PDFs?

I want to compute the Anderson-Darling statistic to use as a goodness of fit test for some PDF distributions. I am using R. I want to compare some models to the observations, which are my baseline. ...
0
votes
0answers
37 views

Transformation of data for normality

I'm intended to run a linear regression model (Rain~dBZ) for my data set. I would like to know how to transform non-normal set of "Rain" column in to a normal distribution. I would really appreciate ...
0
votes
0answers
6 views

How do I do feature selection using Bayesian networks?

I have two classes and a load of high dimensional data and samples, how does one go about selecting features by Bayesian networks? I can find details on how to make the network, but no packages in R ...
1
vote
1answer
18 views

Optics\dbscan produces cluster size smaller than minPts

I'm using optics from dbscan package: ...
0
votes
0answers
15 views

How to make sure that applying a function to each row with “apply”, the result is put together in a row-wise manner? [migrated]

Let's say I have the following data frame: df <- data.frame(replicate(5,sample(0:1,10,rep=TRUE))) and I apply some function to each row ...
0
votes
0answers
9 views

Package Arules with a twist: duplicated items in each transaction

I am interested to work on this: For arules package in r, we could find what's most likely purchased within 1 market basket as referred to ...
0
votes
0answers
5 views

Forecasting Call Center Wait time with Unknown Staff Levels

I am trying to forecast the median wait time each hour for a customer to get served in a call center. I know the median wait times each hour and the number of customers who called in each hour ...
0
votes
0answers
13 views

Function for a peaked curve shape using Nonlinear Least Squares Fitting

I am looking for a function which could fit a NLS model to the below attached sample data set. The data looks somewhat gaussian, but often with a right or left skew and tails to both sides (in some ...
0
votes
0answers
27 views

Plots in R involving two categorical variables [migrated]

I have data containing v1<-sample(c( "A", "B","C","D"),100,replace=T) v2<-sample(c(0,1),100,replace=T) dta<-data.frame(cbind(v1,v2)) Both ...
0
votes
1answer
30 views

Constructing Deterministic Trend and AR(1) and Forecasting in R

I am trying to implement/generate a process using arima.sim like this: $Y_t = a + b*t + \epsilon_t$, where $\epsilon_t = \phi\epsilon_{t-1}+\gamma_t$ a AR(1) ...
1
vote
0answers
22 views

In glmnet, how do I identify Lamdba for a specific AUC value [closed]

I've got a large data set (n>11000) with a large number of predictor variables (~100) and the aim is to develop a satisfying species distribution model with as few of these predictors as possible. So ...
1
vote
0answers
19 views

How to identify the prediction equation from a regression model using splines

I find it difficult to connect the coefficients of a regression model that includes splines to the actual prediction equation. For example, how could that be done with the following model? ...
3
votes
1answer
63 views

Mixed model or ANOVA on differences in pre-post design

I want to analyse the effect of different treatment types (control, treatment1, ..., treatment4) on the surface of specimens made of certain materials (...
1
vote
0answers
8 views

Model Averaging: Standard Error vs Adjusted Standard Error

I'm having trouble understanding when to use Std. Error or Adjusted SE in model averaging (model.avg). What/Why/When to use Adjusted SE? This is my code: ...
2
votes
1answer
28 views

auto.arima Not Minimizing AIC

I simulated a MA(3) process using: ...
0
votes
0answers
5 views

Model matrix and set of coefficients show different numbers of variables [migrated]

I am using the mice package for R to do some analyses. I wanted to compare two models (held in mira objects) using pool.compare(), but I keep getting the following ...
0
votes
0answers
18 views

Correct mode to fit power law

I have a simple network and I'am trying to create the plot of the degree distribution. The question is: the fit_power_law function parameter must be degre (...
0
votes
0answers
42 views

How to compute probability

I have a dataset consisting of 4000 observation from each 324 continuous features are extracted. Each observation has been labeled a class. Since each feature from that dataset is continuous, have I ...
1
vote
0answers
13 views

GARCH with Student errors produces an error message in R (but GARCH with normal errors runs fine)

I am estimating the volatility of exchange rate returns using GARCH(1,1) with the following code: m1 = garchFit(~1+garch(1,1), data = EUR_SEK, trace = F) As soon ...
1
vote
0answers
22 views

Adjusting for seasonality doesn't seem to work?

I am trying to adjust my data (stored as ts object in R) for seasonality. I have followed the instructions here [missing link]. ...
0
votes
0answers
9 views

`auto.arima` warning message: NaNs produced (in coefficient variance matrix) [migrated]

I got a warning from function auto.arima in "forecast" package in R, which said: ...
0
votes
0answers
12 views

Several variables in correlation matrix output

I'd like to improve a big correlation matrix output correla, because I want to see significante values (p<0.05) but with my code is very dificult to find ...
3
votes
0answers
14 views

Proper Specification of Balanced Repeated Replicate Weights in R Survey Package

I am trying to properly apply BRR (balanced repeated replicate) weights in the R Survey Package and I am using the National Center for Education Statistics ELS 2002 dataset. I am not sure how to ...
0
votes
0answers
16 views

How to do a mathematical sum in R? [migrated]

I have the following mathematical formula that I want to program as efficiently as possible in R. $\sum_{i=1}^{N}(x_i-\bar x)(y_i-\bar y)$ Let's say we have the following example data: ...
0
votes
0answers
16 views

Naive bayes on continuous data

I am having some problems computing the probability of given class, using the naive bayes method. My dataset set consist of 4 features , and 3 classes. I know the distribution of all 4 features ...
0
votes
0answers
8 views

R caret: leave subject out cross validation with data subset for training? [migrated]

I want to perform leave subject out cross validation with R caret (cf. this example) but only use a subset of the data in training for creating CV models. Still, the left out CV partition should be ...
2
votes
0answers
25 views

McDonalds omega: warnings in R [migrated]

I'm computing omega for several different scales; and get different warning messages for different scales with different omega functions in R. My questions are regarding how to interpret these ...
0
votes
0answers
28 views

Multilevel models with dynamic membership

I would like to estimate a 3-level random intercept model. I use Stata for the estimation, where it is done by using the xtmixed command. In this model, company ...
1
vote
0answers
10 views

Equal Precisision confidence band not getting sufficient coverage [closed]

I'm looking at confidence bands for the survival function of right-censored data. In particular the Hall-Wellner band and the equal precision band (by Nair). Using the km.ci R package I did a ...
0
votes
1answer
18 views

How to use principal component to fit linear regression for pairwise relation in R

I have been struggling with this problem for several months. I would really appreciate if someone could help me solve this. I am working on a pairwise relationship as shown in the data below (...
0
votes
1answer
22 views

Weight or impact of variable in correlation

Consider I've have two curves (catgeory1,category2) that are strongly negatively correlated( -0.88). for 1, I've few sub-category (o,p,q,r,s,t,u,v,w,x,y,z). I want to know the weight of each one in ...
0
votes
1answer
27 views

Select and aggregate time series based on selection information of a second dataset

General problem: I have two datasets in r and I do not know how I can calculate information across groups of time series in one dataset based on selection-information of another dataset. The details: ...
0
votes
0answers
17 views

Getting very Low accuracy for text classification

I am using naive bayes for multi level text classification in R but unfortunately the accuracy level is very low. Please see the below code which I using for the same: ...
0
votes
1answer
26 views

Question about rolling forecast horizon

I'm trying to understand how the rolling forecast example below from Rob Hyndman's blog works. In the final line of the for loop, is ...
1
vote
0answers
21 views

Fitting a multinomial regression with multiple dependent variables and random factors (R)

I have a dataset with multiple dependent variables, which are counts of about 53 different categories of debris found on beaches. I also have a variety of independent variables, some of which I am ...