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

0
votes
0answers
7 views

calculating probability that certain subject is not in the particular cluster

I have a situation where there are n individuals and p features (variables). I do have their cluster information. Here is an example: ...
0
votes
0answers
11 views

How to calculate the robust standard error of predicted y from a linear regression model in R?

How can I calculate the robust standard error of the predicted y from a linear regression model in R? Any suggestion is appreciated.
0
votes
0answers
5 views

Two class unpaired test using LIMMA

I want identify the set of genes that are significantly-differentially expressed in two different classes of samples. For Example, Normal and Disease. Both classes have samples from different stages, ...
0
votes
0answers
7 views

e1071 svm queries regarding plot and tune

I am new to R and I am learning the e1071 packages' svm function. Following are the few questions I have. How does the plot function work? I cannot understand the plotting case with more than 2 ...
1
vote
0answers
3 views

What does “(scores mapped into 1:m using rounded scores)” from the 1-sample permutation test mean?

I'm trying to do an exact paired permutation test. What does this "mapping" mean? ...
0
votes
0answers
9 views

Mixed Model Analysis of Experiment Data using lmer() Function (lme4 package in R) where Levels in Stimulus Grouping Factor equal Observations

I am running a post-hoc analysis on the data collected during an experiment in which 15 unique stimuli were presented to participants. Having run a least squares regression using the lm() function in ...
0
votes
0answers
8 views

Identifying duplicated rows [migrated]

I have a larger data frame (~50K rows and 50 to 75 columns) that has a small number of row that are duplicated in, say, 7 of the 75 columns. Although it's simple enough to locate rows that duplicate ...
0
votes
0answers
29 views

R lm without intercept strange contrast

I am actually doing a linear regression without intercept lm(y~ -1 + a + b + c + d ), where b, ...
1
vote
0answers
34 views

How can I constrain my regression coefficients such that they are positive and sum to be less than or equal to 1? (In R)

I've seen a few similar questions about constraining coefficients so they sum to 1, but I'm not sure if there's a simple change in these approaches to allow the sum to be anything in [0,1]. I need to ...
4
votes
0answers
24 views

glmer in lme4. How scared should we be about convergence warnings

If we a re fitting a glmer we may get a warning that tells us the model is finding a hard time to converge...e.g. Warning message: In checkConv(attr(opt, "derivs"), opt$par, ctrl = ...
0
votes
0answers
17 views

Alternative to forecast() and ets() in Python?

I'm looking for a Python alternative to R's ETS() from forecast(). It's my understanding that ETS() is one of the best performing forecasting program and I would like to use it. However I am ...
0
votes
0answers
14 views

Running time dependent covariate model in R, getting warning

I am trying to fit this model, but it's giving a warning message I don't understand: ...
0
votes
0answers
10 views

Selecting multiple variables into model starting with common name in R [migrated]

As in SAS we can start multiple varibles using colon(:) option with start name. I wanted to do the same in R for modeling purpose. Any suggestions?
0
votes
0answers
18 views

How to install RJDBC package [on hold]

How to install RJDBC package? Because my network connection is not good to connect to the repo. Please tell me.
0
votes
0answers
8 views

Random effect model result of R and JMP

I have two groups of people, namely A and B. We have the hourly mean heart rate for 45-80 hrs, length differed by individual. We are interested in the group*time effect on the heart rate. Since I have ...
1
vote
2answers
70 views

What algorithm does ward.D in hclust() implement if it is not Ward's criteria?

The one used by option "ward.D" (equivalent to the only Ward option "ward" in R versions <= 3.0.3) does not implement Ward's (1963) clustering criterion, whereas option "ward.D2" implements ...
-1
votes
0answers
8 views

Inverse Wishart prior in Bayesian mixture model

i'm trying to fit basic Bayesian mixture model for bivariate normal and uniform distributions. Basically when I increase degrees of freedom parameter (wishart_df) I ...
-1
votes
0answers
11 views

R: creating a new column in Quandl data [on hold]

Beginner R user here. I am trying to recreate this! Quandl for R tutorial. Here is the code in GitHub. When I run lines 81 and 82 I get an error message stating "Error in ...
2
votes
1answer
16 views

Varying Non-Linear Parameters Based on Groups in R

I'm trying to develop a non-linear model, but I'd like to have the values for the parameters vary by group. To give you an example, a section of my data (just random numbers here) looks like: ...
1
vote
0answers
6 views

Labels missing in R likert plot [migrated]

I am trying to plot a simple likert graph. Somehow I am not able to set the value of legends. Can anyone please tell me how can I do that? The following is the ...
0
votes
0answers
6 views

R - Robust Ancova: Documentation/Examples for the ancmg function in the WRS package

Could anyone point me to a documentation or even better an example for the ancmg1 or ancmg functions of the WRS-package. There is a very short paragraph in the Wilcox' book about Robust Estimation, ...
1
vote
1answer
22 views

Model specification with Deflators: methodological question on forecast model

I am trying to build a model to predict one year ahead Earnings per share $(t+1)$ based on variables in year $t$. I’ve seen a lot of models in practice that use the following methodology: ...
2
votes
1answer
31 views

Exact central confidence interval for a correlation

I am working my way through (T.J. Diccio & B. Efron, "Bootstrap Confidence Intervals", Statistical Science, 1996, 11(3), 189–228), and I'm stuck even before I get to the good stuff. In the ...
0
votes
0answers
8 views

nonlinearTest() in S-plus vs R

Is there any similar function in R does the same thing as nonlinearTest() in S-plus? I am currently working on determine the number of regimes,delayed parameter d and threshold values for the ...
0
votes
0answers
8 views

VARMAX model in R

Is there a function in R that estimates the VARMAX model? There is one for a VARX (MTS package), but I didn't find one that works with the MA part also...
0
votes
1answer
49 views

Variance of $\bar x$, simulation with non-iid observations

So I know that the variance of $\bar x$ is usually computed as $\frac{\sigma_x^2}{n}$, and that this assumes the observations are independent. If instead, the observations have some positive serial ...
0
votes
0answers
4 views

Time in years(x axis) shows years in .5 interval - Time Series using R [migrated]

dsales1156ts<-ts(dsales1156,frequency=365,start=c(2011,6)) # This is my time series created with daily sales data when the first sale day is 6th January 2011. plot(dsales1156ts) The ...
0
votes
0answers
14 views

Controlling overfitting with random forests for very high dimensional data

I'm using the randomForest package in R to analyse a genetic dataset of ca 100 samples with 10.000 genes. The samples are grouped into 5 classes, the smallest being only of 5 samples. I'm ultimately ...
2
votes
1answer
30 views

Using proper scoring rule to determine class membership from logistic regression

I am using logistic regression to predict likelihood of an event occurring. Ultimately, these probabilities are put into a production environment, where we focus as much as possible on hitting our ...
3
votes
1answer
14 views

Presenting results of a meta-analysis with multiple moderators?

I wish to present the results of my meta-analysis using the best practices possible. I do not find, however, examples in articles similar to what my output is. Here's a simplification of my model and ...
1
vote
0answers
25 views

Multiple and long seasonality for a SARIMA model in R

While working on a big data set made of 10-minutes-points of information - i.e. 144 points per day, 1008 per week and ...
0
votes
0answers
13 views

R geom_smooth: what to write as aes [on hold]

I work with R and ggplot but I'm very new with it. I have already drawn point for 4 different data frames. And now I want to draw 4 regression lines for this points sets. Data frames are packed in ...
0
votes
0answers
11 views

Obtaining the Psi Weights of a seasonal ARIMA in R

I am trying to quantify the effect of a future random shocks on my seasonal ARIMA model. If I have understood the theory correctly, the easiest way is to express my seasonal ARIMA model in its "random ...
0
votes
0answers
5 views

Fit GAMs with minimum constraints

I have a two-dimensional predictor plane, 0-1-Observations and a priori knowledge of minimal probabilities per combination of the predictors. I would like to fit a model (e.g. GAM from the mgcv ...
1
vote
1answer
35 views

detect line in scatter

I have repeated samples from the following process: Most samples will only contain points that are randomly distributed on a 2-dimensional plane. Sometimes, however, the sample will contain not only ...
0
votes
0answers
12 views

What is the best test to estimate the correlation between binomial/categorical dataset?

I'm trying to analyze if there are correlations between binomial dataset. I have binomial data (presence/absence) of two variable in different periods and I need to know what is the best way to find ...
0
votes
0answers
9 views

IT-AIC approach for mixed effects model

I was reading around the Information Theoretic-AIC approach of model selection where AIC values are used to select the candidate set of models. I am quite clear on this. My question is this: for ...
1
vote
1answer
21 views

Model Formula with deflator

I'm having difficulties to find the right model formula for my model: $Y_i=a+bX_i$ where Y and X are both deflated by another variable y1/def ~ x1/def + x2/def ...
0
votes
0answers
11 views

Predicting whether a potential sale will be won or lost

I am currently working on a project using a sales system and trying to come up with a way to use the current pipeline of potential sales to predict the amount of product that will be sold in the ...
1
vote
0answers
33 views

including interactions in a mixed linear model in R (lme)

I'm trying to test for the effect of soil moisture on transpiration rates. I have plot-level data for 18 plots in 6 different stands of trees (3 plots x 6 stands). I want to treat "stand" as a random ...
0
votes
1answer
40 views

Non-significant factors after stepwise regression [duplicate]

I have run a stepwise regression on R. However, the summary of the final model includes some factors that are not significant. Why have these factors not been removed? Should I remove these from my ...
0
votes
0answers
28 views

Time varying coefficient time series [on hold]

I have a data set which is the exchange rate of USD and GBP from 2007-01-07 to 2014-06-06. I used the derivatives of a probability density to estimated the optimal bandwidth h = 0.04071872. I want to ...
4
votes
1answer
85 views

Model with non-linear transformation

I don't understand this concept well and need help. I was choosing whether to use a linear model or apply a non-linear transformation in my model formula. To do a diagnostic, I quickly plotted my ...
1
vote
2answers
51 views

K means clustering inadequate in determining extreme regions in R

I want to identify the regions that are considerably higher than the highest cluster. (The obvious regions which should be identified as their own clusters, notably at the x coordinate ~10 e+07. How ...
0
votes
0answers
18 views

Simulation of a nested demand structure, depending upon price and time, following a poisson process

Suppose I sell a product to prices $p\in \{50,100,200\}$ to different points in time $t\in \{1,2,3\}$. Thus a poisson distributed random variable $Y_{t,i} \sim \text{Poi}\left(\lambda\left( ...
0
votes
0answers
15 views

Create correlation map [on hold]

I'm aware that you have a post on almost exactly the same topic, but after many trials I failed to run (or plot?) it successfully. When running ...
0
votes
0answers
14 views

Missing Value in Commodities Prices

I am trying to model the prices of four energetic commodities with ARIMA models in R. Unfortunately the price series is not regular, as for some days, like Christmas, no price is given. My series is ...
0
votes
1answer
44 views

identify different points [on hold]

I have a large scatterplot, with about 100,000 (x,y) points. The x coordinate is the set of numbers from (1 to ~100,000) - in other words, no 2 points have the same x-coordinate. The y is mostly ...
1
vote
1answer
24 views

How are error terms calculated for moving average model in R [duplicate]

For an ARIMA (0,0,1) model, I understand that R follows the equation: xt = mu + e(t) + theta*e(t-1) (Please correct me if I am wrong) I assume e(t-1) is same as the residual of the last observation. ...
0
votes
0answers
14 views

How to make IPF code faster and more concise in R

Iterative proportional fitting is a way of adjusting 'internal cells' in a multidimensional matrix to optimise fit. It is also known as 'raking' and can be seen as a subset of 'entropy maximisation'. ...