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
1answer
16 views

pruning Neural Network

Since a feedforward NN with a logistic function as activation function is not linear, does it make sense to reduce variables first with principal components or discriminant analysis? Because ...
2
votes
1answer
41 views

Expected survival time from log-logistic survival model in R from survreg

I'm currently estimating a survival model (accelerated failure time model) with a log-logistic distribution in R using the survival package and the survreg function. I want to simulate expected ...
0
votes
0answers
6 views

biased random guess classification

I try to get used to some classification methods in R (kNN, Decision Trees, SVM) and I am just wondering: Is there a way to do a biased random guess classification to see the real performance of the ...
2
votes
0answers
21 views
+50

What deviance is glmnet using to compare values of $\lambda$?

One criterion for selecting the optimal value of $\lambda$ with an elastic net or similar penalized regression is to examine a plot of the deviance against the range of $\lambda$ and select $\lambda$ ...
1
vote
2answers
35 views

How can I model a binary outcomes in time series using logistic regression?

My data has a binary outcome (attack or not attack), day (20 day in repeated measured design) and some covariates (nestling’s movement). The objectives of my experiment are testing the effect of time ...
-1
votes
0answers
19 views

Simulating from an initial vector in R [on hold]

How can I perform a Monte Carlo simulation on the entire vector in R I have a vector of 1000 values I would like to simulate the entire vector say 10000 times. I know that to simulate in R we do ...
8
votes
2answers
717 views

P value for interaction term in mixed effects models using lme4

I'm analysing some behavioural data using lme4 in R, mostly following Bodo Winter's excellent tutorials, but I don't understand ...
2
votes
1answer
20 views

understanding proposal distribution sequential importance sampling in R

From the article of wikipedia http://en.wikipedia.org/wiki/Particle_filter I see that one generate samples from the proposal $\pi(x_k^{(L)}\vert x_{o:k-1}^{(L)},y_{1:k})$, however, the role of ...
15
votes
3answers
4k views

Testing significance of peaks in spectral density

We sometimes use spectral density plot to analyze periodicity in time series. Normally we analyze the plot by visual inspection and then try to draw a conclusion about the periodicity. But has the ...
-1
votes
0answers
29 views

When to use K mean clustering and hierarchical clustering algorithm? [on hold]

Can you please tell me when to use the K-mean clustering and hierarchical clustering algorithm and what is the different between them... Regards, Rahul
0
votes
0answers
4 views

Adding a trend line to a scatterplot using R [migrated]

I have a data set with number of people at a certain age (ranging from 0-105+), recorded in the period 1846-2014, and I am making a scatterplot of the summed amount of people by year; there's one data ...
3
votes
1answer
22 views

Metafor package in R: Ranktest for multivariate meta analysis

I have done a multivariate meta analysis with R, with support from metafor package. I am using rma.mv-method which gives an R object of class c("rma.mv","rma"). My question is about looking for funnel ...
0
votes
2answers
52 views

how many factors (new to factor analysis)

I'm using R (factanal) to analyze some data. I know from reading that there are various ways of picking how many factors to use in the analysis. I don't know which to choose, or how to do any of ...
0
votes
0answers
5 views

Outlier detection with data (which has categorical and numeric variables) with R

Scenario I have a project about fraud detection where i need to find outliers by kmeans. I have a dataset about bank credits length of 1000. There are 21 columns (14 categorical, 7 numeric ...
1
vote
0answers
34 views

How to do a mixed (between- and within-subjects factors) ANOVA with Greenhouse-Geisser correction with {car}Anova in R?

I often have to do repeated-measures ANOVA with Greenhouse-Geisser or Huynh-Feldt corrections, so I use Anova (as described in ...
0
votes
1answer
57 views

Measuring longitudinal data where individuals have missing observations

We have a longitudinal panel of X users with their online spending patterns and are trying to measure certain metrics within the panel. We have time series information about the users such as their ...
1
vote
1answer
13 views

Interpretation of ivreg() diagnostics in R

I'm trying to wrap my head around interpreting the diagnostics of the ivreg() command in R, from {AER} package. Running the example code provided in the help page: ...
0
votes
0answers
6 views

troubleshooting R BayesFactor package - error in regressionBF [on hold]

I want to use regressionBF to run all subsets regression. Here is my code: fitness.bf = regressionBF(VO2 ~ ., data=fitnessdata) and here is the error it spits out when I try and run the code: Error ...
0
votes
0answers
15 views

Correlated topic models in the lda R package

Can someone either explain to me or link to documentation which explains how to use correlated topic models in the lda package for R, the official documentation ...
1
vote
1answer
18 views

Estimation of a system

Suppose we have a system that essentially evolves as follows: ...
0
votes
1answer
73 views

Chow Structural Test in R

I am sitting on a pile of data concerning wages at a local company and other information, such as the gender, whether the person in question belongs to a minority group etc. What I would like to ...
0
votes
0answers
16 views

Joint distribution R [migrated]

I have a list of 10 stocks, with each having a time series of log returns (AIG, JPM,...). I have calculated the log returns for each of the stocks as follows: ...
1
vote
0answers
22 views

VaR with ARMA and GARCH in R

I have a time series of 1255 daily observations (01/01/2008 to 31/12/2012) of a stock log returns, I would like to compute the 1 day ahead VaR for the every single day (meaning for every Day I want ...
1
vote
1answer
124 views

Increasing the accuracy of tbats() forecasts by factoring for correlations between different time-series?

This question builds on my previous question Forecasting Hourly Time Series based on previous weeks and same period in previous year/s. My project is to forecast the number of ~400 different types of ...
7
votes
1answer
2k views

Unable to fit negative binomial regression in R (attempting to replicate published results)

Attempting to replicate the results from the recently published article, Aghion, Philippe, John Van Reenen, and Luigi Zingales. 2013. "Innovation and Institutional Ownership." American Economic ...
4
votes
2answers
141 views

Do you see trends in my residual plots?

Do you see trends in my residual plots? These residuals plot show the standardized residuals against fitted values, origin period, calendar period, and development period. The patterns in any ...
1
vote
0answers
23 views

Difference between calculated inclusion probability and what is returned by sampling function?

I have a (small) population from which I wish to sample. I assign probabilities proportional to $y$. I enumerate the possible samples and then determine the probability of each sample occurring based ...
0
votes
1answer
70 views

rpart maximum input states

I am using rpart for decision tree models and if my dataset has columns with around more than 25 factors/levels , rpart gets stuck and runs indefinitely. So i just wanted to know if there is this is a ...
0
votes
1answer
113 views

Errors when fitting a SARIMAX model in R

Currently working on big data sets, I would like to fit a SARIMAX model to it in order to forecast future values. Here are my questions : Q1. As a matter of information, does anybody know how does R ...
1
vote
1answer
304 views

Issues with estimating the sparse inverse covariance matrix with Glasso

I am trying to estimate the sparse inverse covariance matrix of my gaussian graphical model. I installed the glasso package in R and tried out some examples. After ...
0
votes
0answers
9 views

extracting t value out of pairwise.t.test [migrated]

I would like to know if I could extract t values out of the pairwise.t.test function since it is only reporting the p values. I used the pairwise.t.test() for multiple comparisons after running a ...
0
votes
0answers
16 views

How to add supplementary variables after PCA using principal function (psych package) in R? [on hold]

Is there a way to add supplementary variables to a PCA plot when the PCA was conducted using the principal function from the psych package in R? I know that the PCA from the FactoMiner package has ...
-1
votes
0answers
8 views

R - Is there any package in R which can calculate the implied volatility of a stock? [on hold]

does anyone know any package in R to calculate the implied volatility of a stock? Any reply is appreciated! Thanks in advance!
1
vote
1answer
225 views

Pull out most important variables from PCA

I would like to get the most important variables from a PCA result. I see two clusters in the plot. I now that is possible that there is no only one variable causing this, so maybe I would have to get ...
0
votes
0answers
7 views

Error in creation of JAGS model in R: non-conformable arguments [migrated]

I am currently practicing creating JAGS models in R. I'm using this set of Exercises (http://bendixcarstensen.com/Bayes/Cph-2012/pracs.pdf, specifically pages 18-19). However, one of the practice ...
1
vote
0answers
32 views

Different variable importance results with stabsel and mboost

I'm using glmboost in the mboost package to fit a boosted regression using linear models as the base learner. There are 13200 observations and about 75 variables, ...
44
votes
4answers
18k views

How to choose nlme or lme4 R library for mixed effects models?

I have fit a few mixed effects models (particularly longitudinal models) using lme4 in R but would like to really master the ...
1
vote
1answer
33 views

Using correlations for “explained variation”

I have measured lifetime offspring production in an insect by taking measurements of offspring production at intervals (once per week for 9 weeks). Total lifetime reproductive success is then the ...
1
vote
2answers
38 views

Proportion of variance in dependent variable accounted for by predictors in a mixed effects model

Let say I've ran this linear regression: lm_mtcars <- lm(mpg ~ wt + vs, mtcars) I can use anova() to see the amount of ...
0
votes
1answer
74 views

Measures of goodness-of-fit using multiply imputed data in Zelig

I am running a logistic regression model in R using multiply imputed data created using Amelia II, which I am then analyzing using Zelig. I would like to be able to report some measures of ...
-1
votes
1answer
22 views

Prediction on multiple regression - Python

I have 3 list of value and 1 ground truth data. They all belongs to the same time series. My purpose is with 3 list try to forecast the ground truth data. For example : ...
17
votes
1answer
5k views

How to interpret a QQ plot

I am working with a small dataset (21 observations) and have the following normal QQ plot in R: Seeing that the plot does not support normality, what could I infer about the underlying ...
1
vote
3answers
1k views

Is there an R package which implements weighted maximum likelihood for Rasch models?

Is there a package in R which implements the weighted maximum likelihood method (Warm, 1996) for estimating the person parameters in Rasch Models?
1
vote
1answer
214 views

Correct estimation of arguments for glmmLasso function

I am using glmmLasso for variable selection. In my case, n is slightly less than p and ...
1
vote
0answers
8 views

Multiple Imputation in R on data with repeated measurements

I am working with an occupation cohort exposed to radiation and have a dataset containing a number of variables on each worker, including their job title, year of birth, radiation exposure level, and ...
1
vote
0answers
26 views

How to compare and cluster sets of daily time series?

I have multiple dataframes each representing traffic speed for each day of the year (366 dataframes for 366 days of the year). The raws of the dataframe are timestamp from 00:00 to 23:55 at 5 minute ...
3
votes
2answers
591 views

Estimating ability using IRT when the model parameters are known

I have 3PL model parameters (guessing, difficulty and discrimination item parameters). Is there any function with which I can estimate individual ability from item response data? I tried the function ...
0
votes
1answer
130 views

ANOVA and finding differences between multiple groups over time

I was given a dataset to analyze with two factors, time and treatment, and one continuous dependent variable. Since the same individuals were measured at multiple times, technically it probably could ...
1
vote
1answer
25 views

Why are the beta values provided in lmer() different than simple group means of observations?

In a 2-level mixed-effect model, the equation for level-1 is $$Y_{ij} = \beta_{0j} + r_{ij}$$ where $\beta_{0j}$ is the mean outcome for the $j$-th group. I ran the following model: ...