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

3
votes
3answers
2k views

Pairwise Mahalanobis distance in R

I'm trying to calculate a Mahalanobis-type pairwise distance matrix in R. I have 33 individuals, each with 10 variables. The idea is to get a distance matrix D, where ...
0
votes
1answer
30 views

Implementation for Co-Clustering

I am looking for existing implementations for co-clustering (aka biclustering). I came up with biclust function available in MATLAB, but still I am wondering if ...
-2
votes
0answers
6 views
0
votes
2answers
171 views

Wrong predictions for weekend, but good predictions for weekdays

I have a set of 3 years of daily data. I saw weekly and annual seasonality in the data so I used msts time series and tbats ...
0
votes
0answers
6 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: ...
0
votes
0answers
10 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
1answer
82 views

data analysis about data clustering by vector correlation distance

I am working on data analysis. Given a group of data vectors, each of them has the same dimension. Each element in a vector is a floating point number. ...
4
votes
1answer
100 views

Gamma regression with weights using glm

Is there anyway to give weights to a gamma regression so that the variance is allowed to be different, dependent on a particular parameter(in this case sampling event)? When I try to run my code : ...
9
votes
3answers
4k views

How to measure/rank “variable importance” when using CART? (specifically using {rpart} from R)

When building a CART model (specifically classification tree) using rpart (in R), it is often interesting to know what is the importance of the various variables introduced to the model. Thus, my ...
0
votes
0answers
45 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 ...
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 ...
2
votes
2answers
79 views

Post hoc test for object of class glmerMod in R?

I am running generalised linear mixed effects models in R using the lme4 package. I am wondering if there are any post-hoc tests available for models built using the glmer function? I know the ...
3
votes
1answer
153 views

Nested vs random effect

I'm having a little trouble analysing a data set from the following experiment: we applied 4 treatments (control, ...
2
votes
2answers
102 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 ...
2
votes
1answer
179 views

PAM with Gower distance matrix

My data is is mostly continuous but has one binary variable. I tried the pam algorithm in R with the Gower index, but the number of clusters that give the best ...
1
vote
1answer
62 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 ...
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
22 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. ...
0
votes
3answers
55 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 ...
2
votes
1answer
451 views

How to validate and compare models predicting a binary variable?

I have a question about determining which models are "better" and how to assess that info. Let's say I have three models, each which predicts our bid on won ping. Our bid is a continuous variable and ...
2
votes
2answers
2k views

Interpreting R's ur.df (Dickey-Fuller unit root test) results

I am running the following unit root test (Dickey-Fuller) on a time series using the ur.df() function in the urca package. The ...
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
1answer
28 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
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
7 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$ ...
4
votes
2answers
350 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 ...
19
votes
3answers
8k views

Import stock price from Yahoo Finance into R?

I would like to import the "Last Trade" stock price from Yahoo finance into R. The intention is to work with (almost) real time data. Are there any solutions? Thanks in advance for any helpful ...
0
votes
2answers
1k views

Problem with pvclust in R

Hey, im a beginner to R and trying to run pvclust so as to test a cluster solution. I've managed to load data and run the heirachical cluster, however the code i find online for running pvclust is ...
0
votes
0answers
19 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
1answer
36 views

How am I using KS test incorrectly in R?

Here are the codes I input into R: ...
0
votes
1answer
22 views
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 ...
3
votes
3answers
89 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
139 views

Using R to simulate a sampling distribution under $H_0$

We wonder if the colors (of which there are 6) in “Fun Pack” of M & Ms are distributed at random. Let us define as our test statistic $T$ (and there are many ways we could choose to do this) as ...
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
16 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
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: ...
3
votes
3answers
119 views

Optimal classification model for translating words

I have the following problem: I have a set of English words which I want to translate to Dutch. Of each words I mined a set of possible translations. For example, for the word "Eighteen" I obtained ...
1
vote
1answer
103 views

How fitting a mixture distribution of noncentral Student t components to a one-dimensional sample in R?

I`d like to extract the parameters of a two-component mixture distribution of noncentral student t distributions which first has to be fitted to a one-dimensional sample. My question is closely ...
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 ...
3
votes
1answer
435 views

R limma voom function mean-variance trend

I am using the limma package in R to do some analysis on a count data matrix. I use the voom function and that normally creates a plot with the mean variance trend line in it. Now I created also a ...
10
votes
5answers
574 views

Measuring Regression to the Mean in Hitting Home Runs

Anyone that follows baseball has likely heard about the out-of-nowhere MVP-type performance of Toronto's Jose Bautista. In the four years previous, he hit roughly 15 home runs per season. Last year he ...
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 ...
4
votes
1answer
127 views

Clustering data that has mixture of continuous and categorical variabes

I have data that represent some aspect of human behavior. I want to cluster it (unsupervised) into behavioral profiles of some sort. now, some of my variables are categorical (with 2 or more ...
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 ...
0
votes
2answers
33 views

Analyses of mixed variables

I'm relatively new to statistics, and am currently working some data collected as a part of an interview survey. I have a response variable in ordinal form, which mostly looks into people's ...
2
votes
1answer
115 views

Why does a fixed-effect OLS need unique time elements?

The plm function of the plm library in R is giving me grief over having duplicate time-id couples, even when I'm running a model ...
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 ...
5
votes
2answers
201 views

Measuring effects of categorical factors on binomial outcome with many groups

I'd like to do some analysis of shooting efficiency in basketball when a team is leading (AHEAD) or trailing (BEHIND) by less than 8 points and whether they are HOME or AWAY. Here are a few examples ...