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

Method for fitting censored data in R

I have 320 data points - each has a redshift and a turnover-frequency, and I want to fit a correlation between them (a linear fit). However, 120 of the turnover-frequency values are upper limits. As ...
0
votes
0answers
14 views

Any R packages for mixed logit or probit? [on hold]

I have choice data sets and choice is decided within pairs (Choice A or B). If I have 100 pairs and each pair has each decision values but each pair has different situation, I would need to use mixed ...
0
votes
0answers
8 views

remove factor level if factor level has outlier in any of other columns in R dataframe

Hello I have a dataframe with one column a factor of patient id's, other columns of continous variables. I want to remove patients from the dataframe if they have an outlier observation in any of the ...
2
votes
1answer
12 views

What is a paired observation or paired variable?

The question kind of asks itself, can anyone explain what a paired observation or paired variable is in basic terms? My data consist of the number of words learnt in a week for 19 different ...
0
votes
0answers
19 views

What type of statistical analysis would be best to use?

I'm awful at statistics so could really use some help regarding statistical analysis and which approach to use. Here is what I know - I need to determine, based on stats I have been given, whether ...
0
votes
0answers
16 views

Error in R's pbeta function with log=TRUE. Why could it be? [on hold]

R's function pbeta is supposed to calculate the incomplete regularized Beta function. If the flag log=TRUE is passed as an ...
0
votes
0answers
8 views

Using predictive algorithms for descriptive purposes? Correct? Any resources?

Newbie here. I've been learning lots of predictive modeling with R/python using the well-known algorithms: decision trees, random forests, SVM, logistic/linear regression, k-Means, k-NN. But I'm new ...
0
votes
0answers
10 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
0answers
21 views

linear regression - what tests will support my results?

I have collected data about daily bitcoin returns to the US-Dollar and calculated an online sentiment value with data from a social media platform. I further made a linear regression on that data ...
0
votes
2answers
44 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
12 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
11 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
12 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
22 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
35 views

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 ...
0
votes
0answers
8 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
27 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? ...
0
votes
0answers
9 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
55 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
32 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
0answers
10 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
16 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
17 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 ...
1
vote
0answers
9 views

How to use caret to perform regularization with large data? [on hold]

I have a very large data set, with about few million rows and 10K columns, where the data is formatted in a wide-format. So I tried to do regularization with Caret, using the following line: ...
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
16 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
37 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
5 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
19 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
12 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
49 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
7 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
8 views

Compute confidence cutoff for scatterplot

I have data collected from two different individuals for different treatments, like this: ...
1
vote
0answers
29 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
19 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
34 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
8 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
8 views

reversed output in RandomForest predict function in R

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
22 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
24 views

How to remove normalization function on data? [on hold]

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 [on hold]

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 ...