Use this tag for any *on-topic* question that (a) must have an `R`-based solution yet (b) is not *just* about how to program in `R`.

learn more… | top users | synonyms

2
votes
0answers
22 views

Temporal Correlation in R

Having used stack overflow for years without signing up I now truly need some help! My data consists of samples collected from the same location in three different streams between 2012-2014. The data ...
3
votes
0answers
38 views

Entropy estimation for a symbol sequence

I am looking for an R-implementation of the Lempel-Ziv data compression algorithm, to estimate the source entropy of a time-series consisting of a sequence of symbols. Rather than simply measuring ...
0
votes
0answers
11 views

Proportional data with multiple responses

I am trying to analyze a data set in which the response variable is a proportion that can range from 0-1 (inclusive). This response was measured from the same individuals under four different ...
0
votes
0answers
15 views

How to convert numeric value to date format [migrated]

I imported .csv file containing a date in one field. But when I use mode() for that variable, it shows as numeric. My ...
0
votes
0answers
34 views

R package fitdistrplus: function fitdist shows unusual error

I used the package R fitdistrplus in order to estimate parameters of different distribution function. In one case it shows a strange error message I can't interpret: ...
2
votes
1answer
93 views

GLM for count data

I ran an experiment with an eye tracker and my data frame has this look: ...
1
vote
0answers
30 views

Neural net model - error during training

I'm getting started with R, I really like it but recently I found myself in a corner. I'd like to build neural network model that predicts heat consumption. I have historical data that contains ...
1
vote
1answer
53 views

cluster plot: working and interpretation ?

Recently I have come across usage of cluster plot, which combines k-mean clustering along with PCA. The plot shows different clusters plotted using first two PCs. I have checked some of the threads ...
1
vote
0answers
14 views

MaxDiff Scaling

MaxDiff scaling is a very popular method for understanding customer preferences. I was wondering if we can create a survey questionnaire for MaxDiff analysis in R. Can anyone shed some light on this. ...
3
votes
0answers
42 views

How to modify post-hoc power analysis simulation to perform a-priori power analysis?

I am interested in doing a sample size calculation for exacerbation rates. I am drawing my data from a negative binomial distribution and my test statistic is based on a negative binomial glm. ...
0
votes
0answers
43 views

What is the difference between forecasting based on ARIMA and logistic curve? R

I'm making a project connected with identifying the dynamics of sales. My database concerns 26 weeks (so equally in 26 time-series observations) after launching the product. This is what my database ...
2
votes
1answer
43 views

Where do I declare prior parameters in Stan?

I am fitting several multi-level hierarchical regression models using rstan. Each of these models has a unit information prior over the top-level distribution. The ...
0
votes
0answers
10 views

R: Shapiro-Wilk test with relation of W and P-Value? [duplicate]

I'm currently learning about the Shapiro-Wilk test for normality and using R for conducting simple experiments. One thing which is confusing me is that I found some results would produce a high W ...
0
votes
1answer
22 views

R's equivalente of scikit's KFold

I'm new to R and I'm trying to set up a basic k folds CV loop. In Python I'd use scikit's KFold. ...
0
votes
0answers
15 views

Mann-Whitney U and KS tests in R are not producing significant results [duplicate]

I wish to compare two test data sets using the Mann-Whitney U and KS tests in R. As a start, I thought to compare two similar sets (an A/A test) expecting to see a highly significant indication of ...
1
vote
0answers
38 views

Meta-analysis of prevalence at the country level

I'm working on a meta-analysis of prevalence data. The aim is to get estimates of prevalence at the country level. The main issue is that the disease is highly correlated with age, and the sample ages ...
1
vote
1answer
31 views

Compare distributions with uneven and small sample sizes

I will be performing my analysis in R but any general mathematical-based answers will be appreciated. I realize similar questions have been asked before but I am new to statistics so please excuse my ...
1
vote
0answers
40 views

Clustering time series of measurements in R

I have a dataframe consisting time series of measurements taken every hour for 366 days or a year. Below is shown a sample of hourly measurements for the first two weeks. I want to cluster days with ...
3
votes
1answer
28 views

Calculating posterior of difference given posterior of two means

I am using R and MCMCpack to do a Bayesian analysis of some data that I have. I have generated posterior distributions (...
0
votes
0answers
5 views

Getting the coordinates of every observation at each iteration of kmeans in R [migrated]

I would like to construct an animation of the kmeans clustering algorithm in R. The animation would show each of the observations (rows) in the the dataset plotted in 2 (or 3) dimensions and then ...
1
vote
0answers
18 views

Finding multivariate clusters with survey data (in R)

I'd like to conduct a multivariate cluster analysis on data from the American Community Survey's PUMS microsample (individual level records). I've only performed cluster analysis before when there are ...
0
votes
0answers
16 views

Multiple Imputation and prediction

hopefully someone has an idea regarding the following problem: I did a multiple imputation using the mice package - now just one step is left: I want to generate final and "valid" imputations for my ...
2
votes
1answer
90 views

Detecting heteroscedasticity - Can I use Breusch-Pagan Test on binary logistic regression?

I'm currently testing a (binary) logistic regression model, which seems to have at least some issues with multicollinearity. Now I don't really trust the data anymore and would like to also test it on ...
0
votes
0answers
26 views

Predicted values for fixed effect quantile regression

I'm currently working with the method proposed by Koenker (2004) and Lamarche(2010) on fixed effects for quantile regression, for this I'm using the RQPD code in R. I would like to get the predicted ...
0
votes
1answer
51 views

Extracting the model p-value for a multiple regression in R

When fitting multiple variables to one outcome via the lm() function in R, summary(lm) gives me the p-values for individual ...
0
votes
0answers
16 views

Repeated Measures Anova in R

If I have multiple entries for a certain subject-treatment combination, will the aov() function correctly handle these entries when running a repeated measures ANOVA? For example, suppose the table ...
0
votes
0answers
23 views

How to interpret log-likelihood outputs from MASS::fitdistr (R)

AIM: Fit the best distribution to columns in a dataset (30k records) so that I can to go on to produce test data that is in a similar distribution. WHAT I'VE DONE SO FAR: Using R, I have found and ...
0
votes
0answers
24 views

R forward stepwise regression [migrated]

In R stepwise forward regression, I specify a minimal model and a set of variables to add (or not to add): ...
0
votes
0answers
6 views

Cannot link gfortran and R on Mac mountain lion when creating shared objects? [migrated]

I am using MAC OSX Mountain Lion 10.8.5 with Xcode 5.1. I have installed command line tools in Xcode. I tried the gfortran-4.2 found here. It worked OK on my Mac if I ran complete fortran programs, ...
0
votes
0answers
15 views

Creating folds for k-fold CV in R using Caret [migrated]

I'm trying to make a k-fold CV for several classification methods/hiperparameters using the data available at ...
3
votes
1answer
53 views

Simulate the distribution of the median

I have done part(a); now I need to do part(b): I want to simulate the distribution of the median $M$ using R. I don't know how to work it out. And for part(c), do I need to use R as well? This is ...
1
vote
0answers
79 views

Monte Carlo integration

I am calculating a simple integral $\int^1_{-2} \exp{x^2}(x+1)dx $ with Monte Carlo method using a linear density function $p_\xi (x) = \frac{4}{9} + \frac{2}{9} x $. Let say I have a a sample which ...
0
votes
0answers
12 views

How to convert the wilcox.test W value output for two independent groups to U in R? [duplicate]

I need the U values of Mann-Whitney test, but the wilcox.test in R outputs only W values. I do not think they are identical, so here is my question - how to convert W to U?
0
votes
3answers
67 views

Multi-peak Gaussian fit in R

I have a large data set composed of several "independent" data frames like this one ...
1
vote
1answer
64 views

Forecasting with holiday dummy variables

I have an example of call center data for 2013. There are 261 days of data (excluding weekends). For 2013, I have included a holiday dummy variable (holiday) for ...
0
votes
0answers
14 views

Interpretation of three-way interaction in an output of lmer

I am using lme4 to run a three-way interaction model. I have three independent variables: animal (rat, lion, dog), color (red, green, blue) and sex (male, female). The baselines are as follows: ...
3
votes
1answer
73 views

Using glmer to estimate treatment interactions

In my data, I have two treatment conditions with repeated measures for each subject. I would like to run a mixed logistic regression separately for each of my two conditions where my binary outcome DV ...
0
votes
0answers
16 views

How to select a model in quasi-poisson GLM with interactions using drop1 command?

I want to evaluate the effect of three factors (one categorical, and the other two continuous) on the response variable, which is a count data. I have performed 7 candidate GLM models with ...
1
vote
2answers
37 views

Should statsmodels's GLM produce the same results as R's lm?

Should Python's statsmodels.api.GLM(train_y, train_X, family=sm.families.Binomial()).fit().predict(test_X) always produce the same results as R's ...
2
votes
1answer
54 views

Multidimensional Scaling “eurodist”

I have a question regarding Multidimensional Scaling. I used the dataset eurodist from the package datasets to generate a 2 ...
2
votes
0answers
30 views

Neural Network Error Plot Odd Effect

I'm using R to fit a neural network to data generated by the formula $y = x^2 + \epsilon / 2$ where $x \sim \mathcal{U}(0, 2)$ and $\epsilon \sim N(0, 1)$ (very simple, right?). The following plot ...
0
votes
0answers
17 views

Statistical analysis website postgresql

I'm currently working with postgresql on an amazon server ec2 and was wondering what is a good language to represent statistical analysis? I've been told that R is the best but heard from one ...
2
votes
2answers
66 views

A good source to understand interaction in LMM?

I would like to know more about interaction in LMM using lmer. Can you recommend me any books, articles, websites?
1
vote
1answer
38 views

Parametrization of Gamma and Negative Binomial in R

I have some Poisson data {${y_1,...,y_n}$} and a Gamma prior, and I wish to construct a predictive posterior distribution. As I understand, if my Gamma hyperparameters are $\alpha$ (the prior number ...
1
vote
2answers
90 views

How to use the chi-squared test to determine if data follow the Poisson distribution

The figure below (Figure 1 from p. 646 of this paper) compares observed values against expected values under the Poisson distribution. It then runs a chi-squared test to see if the observed values ...
2
votes
1answer
83 views

How important is the correlation coefficient's variance in linear regression?

R doesn't return the correlation coefficient's variance (or standard error) when coding summary(linmod), linmod being a linear ...
1
vote
0answers
34 views

How to augment lpsolve R optimization solution to run on a hadoop cluster? [closed]

I asked same question on stack overflow but didn't get quite a lot replies...wondering if this forum is better.. I am using R lpsolve package to optimize my transportation model. My code runs fine ...
2
votes
1answer
37 views

The effect of ommission of relevant variable in the regression model on adjusted $R^2$

Let's say I have two regression models (I) $y_t=\beta_1+\beta_2 x_2+u_t$ (II) $y_t=\beta_1+\beta_2 x_2+\beta_3 x_3 + u_t$ How the omission of relevant variable (not irrelevant variable) affects ...
0
votes
0answers
11 views

Importing data into R from google spreadsheet [migrated]

There seems to be a change in the google spreadsheet publishing options. It is no longer possible to publish to the web as csv or tab file. Thus the usual way to use RCurl to import data into R from a ...