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

4
votes
1answer
46 views

Hyper-volume of the $\alpha$ contour of a multivariate Gaussian

I'm looking for the assymptotic ($n\rightarrow \infty$) value of (the log of the determinant of) the covariance of the $\alpha$% of observations with smallest Eucledian distance to the origin in a ...
0
votes
0answers
29 views

How to separate distributions from weighted dataset?

I’m trying to separate two component distributions of an apparent finite mixture from a weighted dataset (determined by a weighted.histogram). I've a set of data and weights only for a part of the ...
3
votes
3answers
155 views
+200

ARIMA Intervention Transfer Function - How to Visualize the Effect

I have a monthly time series with an intervention and I would like to quantify the effect of this intervention on the outcome. I realize the series is rather short and the effect is not yet concluded. ...
2
votes
1answer
45 views

LASSO in the data with large number of variables (p) with lower number of samples (n)

I would like to fit LASSO in the following type of data where there are large number of variables (p > n). My y variable is y ...
1
vote
0answers
27 views

code assistance - how to bootstrap and plot paths with a mixed model

I created an Arima (3,1,1) model using the steps below. I was able to create a nonparametric model, but now I would like bootstrap for the created model (model 3). Also I'd like to plot the paths of ...
2
votes
0answers
28 views

R GLM verifying performance statistics for validation

I do not want to say my AUC is 0.77 and find out I am overlooking a lot. Below is my code and a two question at the bottom: ...
0
votes
1answer
36 views

test validation versus k-fold cross validation

I am attempting to use a neural network, after using other machine learning algorithms. I am using the RSNNS package (I am willing to use / evaluate other packages) that's part of R. I would like to ...
2
votes
1answer
41 views

How to get percentiles from empirical density in R?

The density() function in R allows me to enter observations and get an empirical density that I can plot x and y values. I like ...
0
votes
0answers
16 views

Finding duplicate values in a single string of characters in r [closed]

So, I have a string like this. "1101101101" Now, here as we can see, the number '1' is appearing at positions ...
0
votes
0answers
6 views

“Error in drop(y %*% rep(1, nc))” error for cv.glmnet in glmnet R package [migrated]

I have a function to return the auc value for a cv.glmnet model and it often, although not the majority of the time, returns the following error when executing the cv.glmnet function: Error in ...
1
vote
0answers
9 views

is.constant() function in auto.arima() R [migrated]

In R, while viewing the source code of auto.arima() I noticed a function called is.constant(). What is the functionality of ...
0
votes
0answers
16 views

How to use the Huber/White estimator of covariances in a generalized linear mixed model (glmmPQL) in R?

An analysis was implemented in SPSS 22 that uses the "Generalized Linear Mixed Models" feature of the program. Now I am looking for a way to port this to R. I use the glmmPQL() function of the MASS ...
0
votes
0answers
29 views

Forecasting agricultural commodity prices with R

I would like to create a predictive model in order to forecast the price of an agricultural raw material. I got time series for the prices and the production of this raw material, and also for the ...
1
vote
0answers
19 views

Clarification on interpreting Wald's test and Likelihood ratio tests

I am running multinomial logistic regression analysis on my data. The response variable is the number of calves produced each year (0,1, or 2). I am trying to evaluate the influence of the X ...
1
vote
0answers
14 views

which regression model: nested, censored data

I have the following data structures and would like to know your opinion which regression models are most suitable (and available in R) model 1: - 20,000 cases - nested in 500 spatial units (only ...
0
votes
0answers
37 views

Trend: Linear or exponential

I am trying to forecast data using ARIMA. I have read articles which say that I should first take the log of the series, if my series follows an exponential trend. My question is: Is there a ...
1
vote
1answer
35 views

importance of predictor variables in multiple linear regression

I am running multiple linear regression with R. mod=lm(varP ~ var1 +var2+var3+var4) The table is: ...
0
votes
0answers
7 views

Maxent Markov models in R

Is there a package that implements Maxent Markov Models in R? (http://en.wikipedia.org/wiki/Maximum-entropy_Markov_model). I understand that package crf implemets conditional random fields which are ...
0
votes
1answer
31 views

Interpretation of Output

Here is the R code that produced the output below: ...
2
votes
2answers
89 views

How to visualize this data?

Here I have shown the first two lines of my data frame. It goes on for a number of lines. I am wanting to make plots to show what is happening over time . e.g a plot showing the sequence of grip ...
2
votes
2answers
57 views

What is the right way to analyze a nested design in R?

I know that there are already a host of questions about nested designs but many of them haven't been answered or come from biological domains which I sometimes find hard to transfer to my domain. I ...
1
vote
0answers
13 views

Testing for heteroskedasticity of time series in R

I wish to test my time series data for volatility clustering, i.e. conditional heteroskedasticity. So far, I have used the ACF test on the squared and absolute returns of my data, as well as the ...
1
vote
1answer
22 views

ARIMA modeling with more than one Categorical Variable

I am using auto.arima for forecasting. I have more than one categorical variables having more than one level. My questions are : Do I need to do dummy coding ? ...
1
vote
0answers
19 views

How to approach time series regression with one continuous variable and one “ almost Boolean” variable?

I am working in R with daily time series data and have daily observations of two variables. The first is continuous. The second is zero for every day except one, in which it is a number (I'm not sure ...
0
votes
0answers
17 views

R - power.prop.test, prop.test, and unequal sample sizes in A/B tests

Say I want to know what sample size I need for an experiment in which I'm seeking to determine whether or not the difference in two proportions of success is statistically significant. Here is my ...
0
votes
0answers
15 views

Imputation using caret package vs imputation without it

In the caret package, there is the option to impute missing data using decision trees. I already imputed my data by sampling the missing data from a distribution. ...
-2
votes
0answers
33 views

Understanding logistic regression in R [closed]

I am trying to understand logistic regression. I found this link. I understood up until the part at the bottom of the page (where they analysed the UCBA admissions dataset) where they applied the ...
1
vote
1answer
15 views

Stationarity consideration in ARIMA using KPSS test

I have data, which I am sure has a downward trend. I am trying to forecast this data using ARIMA and I want ARIMA to consider the trend when it is forecasting. The first step in ARIMA is to ...
1
vote
1answer
45 views

R scatterplot matrix with nonparametric density

I normally use MATLAB, or JMP but right now am working with R. I have ~150 dimensional data with a few hundred thousand rows. Some of the columns are non-informative, they only have one value. This ...
0
votes
0answers
46 views

Multicollinearity classification regression with R [closed]

I want to do multiple regression, but my explanatory variables are highly correlated with each other. Some are roughly a linear combination of others. To deal with that, I tried to analyse my data ...
5
votes
0answers
47 views

Satterthwaite vs Kenward-Roger approximations for the df in mixed effects models

The lmerTest package provides an ANOVA function for linear mixed effects models with optionally Satterthwaite's (default) or Kenward-Roger's approximation of the ...
2
votes
0answers
31 views

Understanding Singular Value Decomposition in the context of LSI

My question is generally on Singular Value Decomposition (SVD), and particularly on Latent Semantic Indexing (LSI). Say, I have $ A_{word \times document} $ that contains frequencies of 5 words for ...
0
votes
0answers
21 views

Kalman Filter Correction efficiency

I was wondering if Kalman Filter used in a way to correct and reduce forecast errors is useful in real life forecast.Since we are using output forecast data and measurement data from t-1 to correct ...
1
vote
1answer
97 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 ...
1
vote
0answers
13 views

R, lavaan package, latent change model: Definition of change parameter?

I'm currently struggling with the latent change model that I try to realize in R with the lavaan package. R can't estimate all standard errors, which makes me believe that the model is not fully ...
2
votes
0answers
16 views

Estimating correlation between random slopes and random intercepts using the lme4 package in R

For answering my research question I am interested in the correlation between the random slopes and random intercepts in a multilevel model, estimated using the R library lme4. The data I have is: Y ...
0
votes
0answers
8 views

How can i get output window in R-commander? [closed]

Hi, I am trying to see my output using Rcmdr package in R. I am unable to see the output because output window is not visible please look at the snapshot of the R-commander window Please help me ...
-1
votes
1answer
70 views

Time series with negative data in R [on hold]

I have data for forecasting like, here negative value is actual data ...
2
votes
1answer
54 views

Value of r, i.e. correlation coefficient, of data points on a horizontal straight line

1) If we use the formula $$r = \displaystyle \frac{\displaystyle\sum_{i=1}^n \left( x_i - \bar{x} \right) \left( y_i - \bar{y} \right)}{\sqrt{\displaystyle \sum_{i=1}^n \left( x_i - \bar{x}\right)^2 ...
0
votes
0answers
15 views

Test mean for discrete data [closed]

This is a hypothetical case. I would like to conduct a survey on how many times people visited the cinema in the previous month. I would like to confirm whether the mean value I obtained from my ...
1
vote
0answers
12 views

Tail index using hill estimator in R [migrated]

As part of my data analysis (of heavy-tailed data) I wish to calculate the tail (for both left and right) indices of around 100 time series of company returns. My data is stored in a large zoo object, ...
1
vote
3answers
58 views

Intervention Analysis Coding in R TSA Package

I am studying intervention analysis in time series with the Cryer and Chan book and am looking at trying to understand how to code the step response interventions. One question I had is how to ...
0
votes
0answers
7 views

ggplot trend line is flat [migrated]

I'm trying to plot a trend line along with a 95% confidence interval for my data in this csv file. When I issue this command: ...
1
vote
0answers
35 views

consequences of lagged dependent variables in panel data

I have some elementary problems understanding the consequences of using a lagged dependent variable in my model. I’m trying to form a predictive model for $Y_{i,t+1}$ for $t+1$ to $t+3$ with: ...
3
votes
1answer
45 views

scatterplot smoothing in r with big dataset: different methods

I have a large dataset (>300,000 rows) with two variables. y is binary and x is continuous & numeric. I'd like to plot y and add smooth curve against x. I understand that loess(y~x) is a solution, ...
0
votes
1answer
18 views

create bins for lognormal data for cluster analysis

I have a series of dollar amounts that are highly right skewed, but are roughly log-normal. i want to put this grouped dollar amount as a predictor variable into a latent class cluster analysis. In ...
0
votes
0answers
15 views

Outlier treatment in Vector Autoregression (VAR) Model using vars package in r

I have the same problem as the following post, but I have more samples and the index of the outlier is known. Outlier treatment in Vector Autoregression (VAR) Model I tried deleting the outliers; ...
1
vote
0answers
10 views

Applying regression models in R [closed]

So, this is a question that I wish to ask. I was reading about linear regression and stuff. I understood that linear regression basically associates two variables with each other. I have a doubt on ...
2
votes
0answers
22 views

Plot directed acyclic graph with scaled edge length

I am trying to design a network (more precisely a directed acyclic graph) with specific edge lengths. The data is on the form of an edge list, and for each edge, there is an associated length. It ...
1
vote
1answer
42 views

Principal components using correlation matrix in R

My understanding is that prcomp and princomp work off the dataset itself (row of observations, across variables in the columns). ...