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

How to fit an logistical autoregression in R?

I modeled the relationship of $X$ and $Y$ by the logistic function. The residual plot displays autocorrelation which I'd like to rid. I want to try adding trend component to $X$, thus the model ...
0
votes
2answers
53 views

How to interpret this interaction in R?

How would you interpret this interaction? The structure of the data is all integer variables. Inc.fix= income, age.fix=age, profit99= profit ...
0
votes
0answers
15 views

R: plotting decision tree with leaves text labels [on hold]

I use a package mvpart (MS -species in sites, TTE - parametres of environment) ...
0
votes
0answers
14 views

Regression with caret and uknown levels [on hold]

I'm trying to perform a cross-validated linear regression with caret. Unfortunately it always fails as some values for levels are not to common and therefore the prediction fails with the error ...
-1
votes
0answers
13 views

Need better guesses for nls [on hold]

I got need better guesses for this nls function, I was wondering if anyone could help me find better guesses. Sorry I don't know how to post code correctly, everything below here is code. ...
-1
votes
0answers
27 views

Structural Equation Modeling in R throws an error: system is computationally singular [on hold]

I am using Structural Equation Modeling in R. Below is the model that I have specified. The error that I am getting while training the model is: system is computationally singular: reciprocal ...
2
votes
1answer
65 views
+50

Putting less weight on certain data points in a series for forecasting

I have a data set that contains outliers (big orders) i need to forecast this series taking the outliers into consideration. I already know what the top 11 big orders are so i dont need to detect them ...
1
vote
0answers
9 views

Is E-Divisive with Medians (the Twitter BreakoutDetection algo) robust and efficient?

There are quite a few algorithms to detect changepoints, outliers, mean shifts, trend shifts etc. out there. Recently I've stumbled upon BreakoutDetection and while it's new and shiny I'd like to know ...
0
votes
1answer
29 views

Adding observations by aggregating existing data

Question I'm aware that generating features from existing data can be a valid method for adding new features for a regression/ML algorithm*, but can you add observations generated from existing data? ...
1
vote
1answer
23 views

What do the the lsmeans (from lsmeans package in r) represent when calculated over a poisson linear mixed-effect model (fit with glmer)

I am analyzing the eye-tracking data from a designed experiment. A simplified version of my data looks like this (You can get the dput() data here), ...
-3
votes
2answers
61 views

Priors in Bayesian MCMC

I am trying to understand how the choice of priors affects a Bayesian model estimated using MCMC. At a basic level I understand that the product of the prior and the likelihood are proportional to the ...
0
votes
0answers
15 views

disease progression R markov chains

hello i have a dataframe, some of the columns include: remission,height,weight,time from diagnosis, age ethnicity, age, patient id remission is 1 or 0 just to be clear i want to fit an appropriate ...
0
votes
0answers
37 views

How to simulate an ARCH / GARCH model in R? [on hold]

Considering a standard form for a ARCH model: How can I replicate the process in R not using the functions such as garchSim? ...
0
votes
0answers
4 views

r : Need content_transformer() called by tm_map() to change non-letters to spaces [migrated]

In the following code, any characters matching "/|@| \|") will be changed to a space. ...
1
vote
1answer
24 views

Does a factor-by-factor interaction term have any literal interpretation?

Following the explanations in What is the baseline level in a factor-by-factor interaction?, it is my understanding that a factor-by-factor interaction term has no literal interpretation. At the very ...
0
votes
0answers
21 views

Determining the optimal lookback length for an arima forecast

How can I determine the optimal lookback length for an arima forecast? ...
1
vote
0answers
21 views

An Algorithm for Maximal Correlation

Given a pair of random variables $(X,Y)$ over a product space $\mathcal{X}\times \mathcal{Y}$, the maximal correlation coefficient is defined as ...
1
vote
0answers
14 views

Binomial regression does not give coefficients for all IVs [duplicate]

I have a dataset with the dependent variable presence / absence (0 and 1) for a certain species. I have three categorised IV's (2 IV's with 3 categories and 1 with 2 categories). To test the response ...
0
votes
0answers
8 views

fportfolio package in R [on hold]

I have been trying to use some of the rolling efficient frontier functions (in package fPortfolio) but I need to feed them with ...
0
votes
0answers
10 views

Binary data available in R [on hold]

I was wondering whether there are any packages in R that contain binary data to work with. The purpose is to fit a probit model. I have looked at several packages and have not found any. I was hoping ...
0
votes
0answers
12 views

Why are results different from R mixed effect logistic regression models with nested random effects?

I have a dichotomous outcome on 2500 individuals. From 18 geographical areas, and many households nested within areas. I need to assess the association between various predictors and my outcome, ...
1
vote
0answers
17 views

How can I plot (multiple) linear regression residual plot “for each coefficient” in R

As a result of linear regression, we can have its residual and see its plot to check whether it shows normal distributed or not as follows : ...
3
votes
1answer
47 views

How to to find and evaluate optimal discretization for continuous variable with $\chi^2$ criterion?

I have a data set with continuous variable and a binary target variable (0 and 1). I need to discretize the continuous variables (for logistic regression) with respect to the target variable and ...
0
votes
0answers
6 views

R: lsa package with the function fold_in() [on hold]

I've got a lsa object, based on a term-document matrix, and now I want to add a new query but still keeping the original lsa space. So I want to use the fold_in() function in the package lsa. But now ...
0
votes
0answers
31 views

Puzzling average of correlated measurements [on hold]

I want to average correlated measurements. Given a set of measurements: x = ( x1, x2, x3 ) whose internal correlations are given by the covariance matrix C. A ...
1
vote
0answers
19 views

How should I treat my covariate in R?

This is covariate age in my logistic regression. How should I treat it? Gets a little insecure. Have tried to read, but still insecure. Right now I treat it as if it were linear. A polynomial is not ...
0
votes
0answers
21 views

Survey Data Cleaning using R [on hold]

R is free software with great performance. In a complex survey, I want to clean data using R. How can I do this? Could any body suggest me some documents or books for cleaning survey data using R?
0
votes
0answers
13 views

Obtaining significance for variables in a linear discriminant function analysis

I have run a linear discriminant function analysis using the lda() function in the MASS library to determine which of 6 ...
0
votes
1answer
57 views

r - choosing correct nnet model

Language: R Background data = 1800 observations (rows) x 5 variables (columns) I am using library(caret) and training regression models using ...
0
votes
0answers
19 views

Predictive model decision tree [migrated]

I want to build a predictive model using decision tree classification in R. I used this code: ...
0
votes
0answers
8 views

Successfully simulated physical process, matches truncated/incomplete data…now what?

What's Being Simulated I have data from a device that tests a physical process. The data are independent Bernoulli trials. Each test series yields a distribution of these trials with different N and ...
0
votes
0answers
9 views

Compute confidence cutoff for scatterplot

I have data collected from two different individuals for different treatments, like this: ...
1
vote
0answers
30 views

Doubt on the Johansen Procedure and normalization of the cointegration matrix in R

I'm a beginner at Econometrics, and I'm trying to learn the main econometric techniques in R. My doubt is on how to normalize the cointegration matrix to ensure ...
0
votes
0answers
23 views

Subsetting dataframe conditions on factor (binary) column (vector in R)

I have a sequence of 1/0's indicating if patient is in remission or not. Assume the records of remission or not were taken at discrete times. How can I check the Markov property for each patient, ...
3
votes
1answer
56 views

Prediction interval for lmer() mixed effects model in R

I want to get a prediction interval around a prediction from a lmer() model. I have found some discussion about this: ...
0
votes
0answers
9 views

R: hclust() calculating variance within each cluster

I've got a distmatrix where the element at [i,j] describes the cosine distance between variable i and variable j. When I use hclust(), and then I use cut.tree to make K clusters, then I would like to ...
0
votes
0answers
17 views

reversed output in RandomForest predict function in R [on hold]

I am using the RandomForest package in R to do classification. I use this in combination with GIS data and so use the package "raster" as well. I run the RandomForest and everything seems fine until I ...
0
votes
0answers
8 views

r : Why is findAssocs() not working? (at all) [migrated]

findAssocs() is not working, as is seen below. "Lucid" and "dreaming" occur together quite often in the book. The corpus is a single document, the text version of a book. Does this function require ...
1
vote
0answers
27 views

How to create a multidimensional data structure in R as input to kernlab's ksvm()

This is a revision/rephrasing of my question originally posted on stackoverflow. How should I create the training/input dataset for a ksvm model with multi-dimensional input data? The process for ...
-1
votes
1answer
26 views

How to remove normalization function on data? [closed]

I currently have my data scaled between the range of 0 and 1 using the following normalization function in R: ...
1
vote
0answers
6 views

R-Studio summary page independent variable percent [closed]

What in R Studio's summary of data shows percent of the independent variable if the dependent Variable is 0? For instance, my Y axis is an independent variable and my question is asking if the ...
1
vote
0answers
16 views

Why is removeSparseTerms() not doing anything? [closed]

This has me very, very puzzled... removeSparseTerms() is not removing any terms. ...
1
vote
0answers
23 views

Information value in logistic regression [closed]

I would like to know the reason why we ignore those variables in logistic regression whose information value is more than 0.5 though it might carry high information about the prediction.
1
vote
1answer
17 views

Crossed & nested random effects in lmer

I'm trying to get the specification correct for a crossed and nested effect model. Suppose I want to cross Sample & ...
1
vote
1answer
20 views

r markov chain markov property on binary variable, discrete time

i have a sequence of 1/0's indicating if patient is in remission or not, assume the records of remission or not were taken at discrete times, how can i check the markov property for each patient, ...
0
votes
0answers
21 views

How do I accommodate for structural change in R? [closed]

I have time series data for hot dog sales, and I have a quadratic regression that includes monthly seasonal dummy variables. ...
1
vote
1answer
23 views

I'm having trouble fitting a general (not generalized…) linear mixed-effect model using the lme4 package. Can anybody help?

I need to fit a linear mixed model in the "Laird and Ware" framework. This type of model is usually specified by (as you may know): $\mathbf{y}_i = X_i \beta + Z_i \mathbf{b}_i + \mathbf{\epsilon}_i ...
0
votes
0answers
12 views

modelling a data-set using copula

I have a data set and I transform the data set in to matrix within range [0,1]. https://drive.google.com/file/d/0B6wp1DiHTjBBOXJoc1JhRG5VSHM/view?usp=sharing Can anyone explain the steps in ...
2
votes
0answers
20 views

Meaning of y axis in Random Forest partial dependence plot

I am using the RandomForest R package and am confused at how to interpret the values of the Y-axis in their partial dependence plots. Help docs state that the plot ...
0
votes
1answer
25 views

How can I get a reasonable residual standard error for my linear model which faces heteroscedasticity?

My goal is to get the residual standard error of my model to be as small as possible. I have a linear model lm(y~x). When I plot the standardized residual errors in function of the explanatory ...