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

Forecast Error Variance Decomposition with restricted VAR model

For conducting Forecast Error Variance Decomposition (FEVD) on a restricted VAR model I use the fevd method in the package vars ...
0
votes
0answers
9 views

Obtaining adjusted proportions in repeated measurements design

I want to compare the blood pressure trend in a population. I have 1000 individuals, roughly and they have been examined from 2003 to 2012. Some individuals, but not all, have been examined several ...
1
vote
0answers
13 views

How to present multiple distributions with R?

I have a stochastic simulation on NetLogo in which my agents accumulate "wealth". Of course, every run gives me different outputs but with pretty much the same distribution. I use histograms to keep ...
0
votes
2answers
26 views

fitting a cubic polynomial to a trend component of time series

I have 295 observations of two variables, of which here are a few: ...
0
votes
0answers
17 views

Predictive modeling with factor analysis [on hold]

I am trying to build a predictive model using factor analysis. in R. Here is my code: ...
0
votes
1answer
22 views

using training data in final model output

I have customer data for around 400,000 customers where 270,000 of them are current customers and 130,000 of them are past customers who churned, what I am doing is classifying them as 0 (non-churn) ...
0
votes
0answers
6 views

More comprehensive summary() function in R? [migrated]

I was wondering if there was a more comprehensive summary() function in R that perhaps includes more model metrics such as confidence intervals around the estimates maybe log-likelihood, AIC, BIC ...
0
votes
0answers
17 views

Kolmogorov-Smirnov using R [migrated]

Long story short, I want to manually write the code for the Kolmogorov-Smirnov one-sample statistic instead of using ks.test() in R. From what I understand, the K-S test can be broken down into a ...
0
votes
1answer
31 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 ...
0
votes
0answers
7 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 ...
-1
votes
0answers
34 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 ...
1
vote
2answers
39 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 ...
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
21 views

Estimation of a system

Suppose we have a system that essentially evolves 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
16 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
7 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 ...
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: ...
3
votes
1answer
25 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 ...
1
vote
0answers
38 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
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 ...
0
votes
2answers
57 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 ...
2
votes
1answer
22 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 ...
2
votes
1answer
52 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
votes
0answers
9 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!
0
votes
0answers
7 views

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

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 ...
4
votes
2answers
144 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 ...
-1
votes
1answer
25 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 : ...
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
27 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 ...
1
vote
1answer
55 views

Using correlation for “explained variation” or $R^2_{GLMM}$

I present using dummy data for an example, see below for R code to replicate data. Imagine that I have collected data on how much mail 500 people receive. In my survey there are 250 men and 250 ...
0
votes
0answers
5 views

Extract predicted values for latent variables in sem [on hold]

I have used the 'sem' package to create a structural equation model with the aim of better understanding the formation and measurement of structural complexity in natural habitats. The objective was ...
2
votes
1answer
28 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: ...
1
vote
0answers
14 views

what is the weight.matrix from the GenMatch (Matching package) in R

So when using the GenMatch function to generate optimal weight coefficients for use in the Match() function. What do these ...
1
vote
0answers
20 views

Forecasting Revenue with Layered Regression

Our business rents products to customers using a variety of payment plans.. ranging from 3-month (high \$ per month) to a continuous rental (low \$ per month). I've created a spreadsheet that shows ...
0
votes
0answers
23 views

What is the difference between two implementations of a random forest? [on hold]

Question 1: What is the difference between these two implementations of a random forest? Both models RF1 and RF2 use repeated cross validation. The only difference I see is that the number of trees is ...
1
vote
0answers
21 views
2
votes
1answer
68 views

R-Metafor: Meta-analysis and mixed effect model

This is an example of my dataset ...
0
votes
0answers
24 views

Itemfit to IRT model with missing data

I have matrix of dichotomus correct/false answers with many random missing data. (The data comes from an ability test where questions were randomly drawn from an item bank.) I am trying to find out ...
-1
votes
0answers
15 views

Linear Regression on multiple categorical variable [on hold]

Can anyone explain How I can interpret my result from the below model : I am trying to build the linear regression model for finding the transaction behavior of the customer in bank accounts. I have ...
0
votes
0answers
9 views

lag length selection in Vector Error Correction Models

I am doing a VECM analysis in R using vars R package. My problem is to find the lag length of the VECM model to be specified. I a previous post I was suggested to use the VARSelect function. However I ...
-1
votes
0answers
22 views

Data Extraction - Historical Weather dataset [on hold]

I want to get worldwide weather dataset from the year 2008 to 2014!... Where do I'll find this data? Can anyone suggest me the best website to extract the data or any other ways to obtain this ...
0
votes
0answers
22 views

Can anyone explain this error message in R? [duplicate]

I am running a mixed effect logistic regression, with two categorical predictors each of which are dichotomous. This is my formula, with variable names changed: ...
0
votes
1answer
44 views

Estimating R^2 when some coefficients are forced (i.e., restricted coefficients)

I am running a regression in R, and wanted to find the right way to calculate the R^2. I have an identity that I am empirically testing with data that is y = x1 - x2 + x3 (unfortunately dont have an ...
0
votes
0answers
4 views

Find the probability of a new data point using “density” function in R [migrated]

I am trying to find the best PDF of a data that has Gaussian distribution, using the "density" function in R. Now, given a new data point, I want to find the probability of this data point based on ...
1
vote
0answers
16 views

lme4 (v1.7) fails at fitting an “animal model” (LMM) compare to rrBLUP

I would like to fit a basic "animal model" (a kind of linear mixed model, see below) using the latest version of lme4 on CRAN (v1.7). To check the results, I am fitting it on simulated data, and ...