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

2
votes
0answers
24 views

How to compare variables' coefficients obtained from lasso?

My situation: small sample size: 116 binary outcome variable long list of explanatory variables: 50 explanatory variables did not come from the top of my head; their choice was based on the ...
2
votes
1answer
38 views

How to ensure that the most appropriate value for lambda is chosen in lasso?

My situation: small sample size: 116 binary outcome variable long list of explanatory variables: 50 explanatory variables did not come from the top of my head; their choice was based on the ...
0
votes
1answer
13 views

How to assess the incremental additive information of a new predictor in a cox model using r?

I want to check whether the addition of the new predictor x3 improves the predictive information of a cox model significantly or not? As far I have: ...
0
votes
0answers
6 views

Comparing coefficients of linear “ Stochastic Frontier Production and Cost Functions” in R

I am using the function frontier::sfa() in R to obtain the Stochastic Frontier Production and Cost Function as followed: ...
0
votes
0answers
23 views

Linear regression vs additive modelling, any meaning when linear modelling has higher accuracy?

I have a simple question. Is there any important meaning when non-linear modelling (general additive modelling such as gamm in R) has lower accuracy than linear modelling? some useful plots are ...
-4
votes
0answers
18 views
0
votes
0answers
13 views

Suppress automatic outputs in Rstudio [on hold]

When i run auto.arima it shows the whole process in the console, which when trying to create a report ends up showing this: http://i.stack.imgur.com/GP58B.png Is there a way to stop this appearing? ...
0
votes
0answers
10 views

Bivariate Zero-inflated negative binomial distribution regression?

I have two correlated random variables, for one experiment, the readout look like: For random variable A: ...
1
vote
0answers
18 views

Please review my app logic - R Newb [migrated]

I want to compare values between 2 consecutive rows of the same column. Example: "Is col1.row1 less than col1.row2" "Is col1.row2 less than col1.row3" "Is col1.row3 less than col1.row4" Is my plan ...
0
votes
0answers
8 views

R Clustering Evaluation (Adaptive Kmeans)

i know there are several threads about this topic, but most i read, most i get confused. I'm doing a project that consists in clustering some data (news articles). I used adaptive Kmeans ...
0
votes
0answers
23 views

regression analysis to find relation among grades of student

I have a data set containing 10 subjects and students grade in those subjects(A+,A,B+,B,C+,C,D+,D) i want to find out out if the grades of one subject is affecting the grades for other subjects. ...
1
vote
1answer
27 views

Is it possible to get a covariance matrix of fitted values for a GLM model in R?

I would like to get a covariance matrix of fitted probabilities for a logistic regression model in R. I would like to do this because I want to find the variance of the difference between the two ...
1
vote
0answers
8 views

Multiple objective allocation function

I have an allocation problem where, for a given good, I have buyer $i$ willing to buy up to quantity $b_{s,i}$ and seller $j$ willing to sell up to quantity $s_{s,i}$. There are $N$ buyers and $M$ ...
0
votes
3answers
57 views

smart sampling techniques in r

I have a large data set of about 1.8 million rows with 80 variables. I would like to find a good technique (code or package) in R that can reduce the amount of training data without damaging the ...
0
votes
0answers
20 views

Bootstrap confidence interval for case control data in R

I have a matched case-control data material and am estimating a risk-measure parameter with a certain estimator. I want to use bootstrap methodology to estimate confidence intervals for the parameter ...
0
votes
0answers
26 views

How to conveniently add a large set of regressors in R? [migrated]

I have to add approximately 30 dummy variables to a regression. If my variables would be named dummy1 - dummy30, I would denote ...
0
votes
0answers
48 views

Has anyone tried to parallelize multiple imputation in 'mice' package?

I'm aware of the fact that Amelia R package provides some support for parallel multiple imputation (MI). However, preliminary ...
0
votes
1answer
23 views

different HRs and corresponding CIs with cph and coxph

I tried a model using cph and coxph: ...
0
votes
1answer
30 views

Computing conditional variance

Is there a package in R that does that? How could I compute the conditional variance $\mathrm{var}(y|x)$ of a sample? I also don't know what to do in case where there are not enough $y$ for each ...
1
vote
1answer
44 views

Is R software being used for commercial purpose as it is open source

I would like to learn R programming as I am interested in learning new programming language. Is R software being used for commercial purpose especially in financial industry.
0
votes
0answers
18 views

In R, when plotting using ggvis, how to specify plot range? [on hold]

When plotting using ggvis(x = ~c1, y = ~c2) the range of both axes are automatically determined. But I would like to show a larger range. How to set it? I read ...
0
votes
0answers
5 views

R- yaimpute - standarize value before KNN for imputation

I need to impute data before running a logistic regression. I'm trying the package yaimpute but I realized that it doesn't standarize before imputing. I created a sample matrix to view so: ...
0
votes
1answer
36 views

How am I using KS test incorrectly in R?

Here are the codes I input into R: ...
0
votes
0answers
7 views

Rcmdr package not installed [migrated]

When I tried to installed Rcmdr package with this command: install.packages("Rcmdr",dependencies=TRUE) I got following error message: ...
4
votes
2answers
354 views

For plotting with R, should I learn ggplot2 or ggvis?

For plotting with R, should I learn ggplot2 or ggvis? I don't necessarily want to learn both if one of them is superior in any regard. Why R community keeps creating new packages with overlapping ...
1
vote
1answer
65 views

What methods are used in order to prove the independence of two variables in statistics?

I have four variables (attributes) describing student. They are categorical data. I need to prove that these variables are independent. The easiest way (even not sufficient) is to see the ...
2
votes
2answers
64 views

Replicating Stata's “robust” option in R

I have been trying to replicate the results of the Stata option robust in R. I have used the rlm command form the MASS package ...
0
votes
0answers
11 views

Hmisc::describe not working with dataframe [migrated]

I need a "describe" function that reports values with more than two decimal places and so I thought I would use the Hmisc describe function but even when using the sample code from ...
0
votes
0answers
5 views

Spatially explicit capture–recapture with R: density estimation of transect detectors in SECR

Dear stakexchange community I am new here and I hope to get an answer about density estimation of transect detectors in SECR. To my data: I collected samples of individuals at eight transects. Data ...
0
votes
0answers
28 views

R Bayesian prediction of a Gaussian process

I have a Gaussian model with mean zero, variance is arbitrary constant, and correlation function $e^{-\theta(x-x')^2}$ where $\theta$ is again an arbitrary constant. I've plotted some realizations of ...
2
votes
2answers
103 views

Mean value of truncated normal distribution

I have a bunch of data where each observation represents an error $\in [0,1]$ (computed error between a variable and it's ground truth). Extra info: These are the results of the difference between a ...
1
vote
1answer
39 views

How to compare count of two groups?

I have a two groups of data - 1/ All data and 2/ Selected_season, which is only some subgroup of all data. I want to find out: a/ if proportion of BM, HB, etc. groups is the same in All data and ...
0
votes
1answer
42 views

Newton Raphson Over-estimates Parameters

I have implemented an almost plain vanilla algorithm to find the MLE estimates of 3 parameters in a log-likelihood function (in R.) When I test my algorithm with some simulated data it does pretty ...
2
votes
2answers
46 views

comparing non nested models with AIC

say we have to glmms mod1 <- glmer (y ~ x + A + (1|g) data= dat) mod2 <- glmer (y ~ x + B + (1|g) data= dat) These models are not nested in the usual sense ...
1
vote
1answer
21 views

testing significance from a non-normal simulated distribution with CIs

Say we have a value B =-0.9631366 of a population level parameter from a real population. Then we use simulations based on some mechanistic knowledge of the ...
0
votes
0answers
14 views

What methods should I use to determine which poll is the best at predicting college football game outcomes?

Okay, So I'm interested in trying to determine which college football polls (AP, Coaches, ESPN, and reddit.com/r/CFB) are best at predicting the outcomes of the Top 25 weekly games. I've collected ...
3
votes
3answers
90 views

Tournament Plotting: Who is good against whom?

I would like to get insight into who is good against whom. Imagine a tournament setting* of 40 contestants and you're interested in seeing who is good against who in the top 10: how could we make this ...
1
vote
1answer
31 views

Is it reasonable to use a combination of two forecasting models for a dataset?

I used tbats to fit a model for a 3 years of historic data and the values work fine but as I did not include holidays, holiday predictions are really off. I used arima with regressor (holidays at ...
0
votes
1answer
36 views

Using R to calculate qt (t-dist) using qf(f dist) help?

I am having quite some trouble using R to calculate, say, qt(0.975,6) using qf instead of qt. I know the relationship between the t-distribution and the f-distribution which I understand as follows: ...
0
votes
0answers
15 views

what is the problem that auto.arima can not provide a model with seasonality for a data set which have strong seasonality?

I have 3 years of daily data which have daily and annual seasonality. I used tbats to fit a model but when I included holiday and weekend regressor, the fitted model did not change with tbats with no ...
0
votes
0answers
11 views

R plm: understand pmodel.response

I need help in understanding the pmodel.response function from the R package plm. So far I have interpreted this as a way to get ...
0
votes
0answers
47 views

Problem Metropolis-Hasting algorithm in R

I have some trouble to write the code for MCMC with Metropolis-Hasting algorithm for the acceptance rate. When I am running my code, there are errors located in the function Metropolis but I don't ...
0
votes
0answers
5 views

Joint model for ordinal repeated measures data and MNAR dropout using R

I have a dataset consisting of repeated measures data of graded toxicity scores (0-4) in a large number of patients being treated with a anti-cancer drug. We would like to identify predictors for ...
2
votes
0answers
16 views

Hypergeometric: how do I construct a credibility interval around K (population successes) in R?

I have a problem for which I believe I should use the hypergeometric distribution, but I can't figure out how to do it in R. Say I have a bag of marbles with known number ($N$) of marbles, but the ...
0
votes
0answers
34 views

Obtaining the SarimaX equation from the arima coefficients

I have a SarimaX model with three regressor variables: ...
0
votes
0answers
13 views

Power/Sample size calculation with R pwr.anova.test

I would like to use pwr.anova.test (R package) to calculate power or sample sizes etc. The function needs several parameters: pwr.anova.test(k = NULL, n = NULL, f = NULL, sig.level = 0.05, power = ...
0
votes
0answers
16 views

Synchronize time series by date and time in R

e.g. i have two time series that describe how much money in specific currency i spent at specific date: ...
0
votes
1answer
14 views

predict data for new group from gamboost model

Suppose I have the following mboost::gamboost model: gamboost(resp ~ bbs(x1) + bols(x2) + brandom(x3), data = data) Suppose I ...
2
votes
2answers
66 views

Different output for R lm() and python statsmodel OLS for linear regression

I'm exploring linear regressions in R and Python, and usually get the same results but this is an instance I do not. I added the sum of Agriculture and ...
1
vote
0answers
18 views

Frequent Itemset Mining / Event / Sequence Analysis in R

I have a 1 column, 2000 row dataframe. Each row contains a customer event sequence that concludes with a purchase of item X. The dataframe looks as follows: ...