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

1
vote
0answers
3 views

Logistic regression gives very different result to Fisher's exact test - why?

I have a confusing situation where I have strongly conflicting results from two ways of analyzing my simple data. I measure two binary variables from each participant, AestheticOnly and ChoiceVA. I ...
-1
votes
0answers
10 views

How to store multiple predicted values in R

I have the below code which is throwing error .I need to store multiple prediction arrays so i'd finally have pred1 ,pred2,...pred99 ...
0
votes
0answers
9 views

Fuzzy regression (using lp)

I want to replicate a fuzzy regression using a linear programming problem approach. I have the following information: " A fuzzy regression analysis with only one independent variable X results in the ...
1
vote
2answers
25 views

Why there is no significant difference between a number list and its 100 times list

I am finding that there is no significant difference between a number list and another list which has 100*same numbers. The P value is 0.4487. The means are obviously very different (100 times). Why ...
0
votes
0answers
4 views

Using interaction terms in an MCMCglmm

I am using MCMCglmm models in R, with hierarchically nested data. The basic structure of the data is as follows - each dyad is a unique combination of focal/other: ...
0
votes
0answers
4 views

MCMCglmm interpretation of effective sample size

I'm running a selection of MCMCglmm models in R, and have a basic question about the outputs. Based on what I've been reading, one indication that the model is mixing well is a large effective ...
0
votes
0answers
8 views

How can I make decisions from the output of predict.coxph()?

I'm studying Survival Analysis for the purposes of customer churn modeling. I've managed to put together a model, but I'm confused about what to do with the output. As I understand it, the output is a ...
0
votes
1answer
26 views

model selection through shrinkage (Lasso) using glmnet

I would like to use model selection through shrinkage (Lasso) using glmnet. After trying the example of the glmnet manual and tried the procedure with my data. ...
0
votes
0answers
11 views

Impute missing values using aregImpute

I have a data frame with 61 columns. Some data is missing. I read in Steyerberg's book about aregImpute in Hmisc. I used it with ...
2
votes
0answers
29 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
48 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 ...
1
vote
1answer
40 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. So far I have: ...
0
votes
1answer
13 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
29 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
19 views
0
votes
0answers
15 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
29 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
9 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
59 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
22 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
57 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
24 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
46 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
19 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
361 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
67 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
29 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 ...
10
votes
1answer
123 views
+150

Invalid inference when observations are not independent

I learned in elementary statistics that, with a general linear model, for inferences to be valid, observations must be independent. When clustering occurs, independence may no longer hold leading to ...
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
44 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
49 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
22 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 ...