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 use `R`.

learn more… | top users | synonyms

0
votes
0answers
7 views

Likelihood ratio tests using ML vs. REML

I am using Mixed effects models (nlme package in R) to choose the model with the best random and fixed effects. I am following the procedure of Zurr et al. (2009) ...
0
votes
0answers
7 views

Test if two means are significantly different in R [duplicate]

I would like to test if two means are significantly different from each other. I am using R and I do this: t.test(SampleA,SampleB) and I get output that looks ...
7
votes
2answers
560 views

What is the intuition behind the variation of information (VI) metric for cluster validation?

For non-statisticians like me, it is very difficult to capture the idea of VI metric (variation of information) even after reading the relevant paper by Marina ...
0
votes
0answers
11 views

Summary statistics for imputed data from Zelig & Amelia

I'm using Amelia to impute the missing values. While I'm able to use Zelig and Amelia to do some calculations... How do I use these packages to find the pooled means and standard deviations of the ...
1
vote
0answers
11 views

R lda() graphing with two groups - histogram or scatterplot?

I am using a discriminant function analysis to see which environmental variables best discriminate my study wetlands into those occupied by a species and those not occupied. I have 23 wetlands and ...
0
votes
0answers
9 views

Plot histogram using ggplots to be similar as hist() in R base [migrated]

I am new with ggplot2. I am using it to plot a histogram. Here is the code ...
0
votes
0answers
2 views

Choice based conjoint latent class analysis in R

How can we perform Latent class Analysis for choice based conjoint data, to both segment respondents and determine co-efficients for attributes at the same point of time? I know there is a package ...
9
votes
2answers
669 views
+50

Importance of predictors in multiple regression: Partial $R^2$ vs. standardized coefficients

I am wondering what the exact relationship between partial $R^2$ and coefficients in a linear model is and whether I should use only one or both to illustrate the importance and influence of factors. ...
0
votes
1answer
18 views

r, caret - preprocessing range vs scale

I noticed that caret preprocessing has a range method to "scale predictors between 0,1". When does this option become more desirable than center and scaling?
0
votes
1answer
19 views

Change settings in the prediction model (caret package)

I am using the package caret and GBM method for my predictions. ...
0
votes
1answer
11 views

Feature selection in GBM

I am using gradient boosting (caret package in R). As far as I understand, the feature selection is already included in this package. However, I slightly ...
0
votes
1answer
30 views

Model validation using features (R)

I'm trying to create a classification model in R, at the moment i'm using 10 fold CV (using the train function of caret package) ...
1
vote
1answer
41 views

How to interpret D-Efficiency in Experimental Design?

I created an orthogonal design in R using AlgDesign package. I got 14 profiles and some output: D =0.2519353; A = 5.462121; Ge = 0.748; Dea = 0.714. How to interpret D , A , Ge and Dea? Also, In ...
1
vote
1answer
80 views
+50

Fitting a variogram model with the pairwise distance matrix supplied

I'm trying to fit a variogram to my data, however the spatial points are confined by an irregular polygon. So I'd like to supply a variogram model function with the distance matrix of the points. ...
0
votes
1answer
67 views

How to test for Zero-Inflation in a dataset?

I have a dataset which seems to have alot of zeroes. I have already fitted a poisson regression model as well as a negative binomial model. I would like to fit zero-inflated and hurdle models as well. ...
0
votes
0answers
17 views
+50

Moment Conditions for Stochastic Discount Factor (SDF)

Following extract has been taken from Computing Generalized Method of Moments and Generalized Empirical Likelihood with R, the Vignette of gmm R package. In some ...
1
vote
0answers
14 views

How to deal with factors with rare levels in cross-validation?

Suppose in a regression analysis in R, I have a factor type independent variable with 3 levels in my train dataset. But in the test data set that same factor variable has 5 levels. Therefore I can not ...
16
votes
1answer
2k views

Use of standard error of bootstrap distribution

(ignore the R code if needed, as my main question is language-independent) If I want to look at the variability of a simple statistic (ex: mean), I know I can do it via theory like: ...
2
votes
1answer
42 views
0
votes
0answers
7 views

Plotting QDA projections in R

When doing discriminant analysis using LDA or PCA it is straightforward to plot the projections of the data points by using the two strongest factors. This can be done in R by using the x component ...
0
votes
0answers
10 views

How to test for interactions of continuous measure with two repeated-measures factors in R?

I am doing an items analysis of difficulty ratings of a large set of math problems which were constructed to represent the factorial combinations of two binary factors, feature1 and feature2. The ...
5
votes
1answer
60 views
+50

mixed effect model design with a sampling variable

I am trying to specify a formula for a linear mixed effect model (with lme4) for my experimental design, but I'm not sure I'm doing it right. the design: basically ...
3
votes
2answers
421 views

Clustering of points based on vector feature similarities in R

I have as an input a number of points that I need to partition into clusters. Each point has a number of features that are ideally to be used to find the similarity between each point and the others. ...
0
votes
0answers
27 views

Forecasting daily visits using ARIMA with external regressors

I have daily visitors data for the last 10 years. I want to do some basic tests like which is the busiest day, which is the busiest month, busiest week etc. I used ...
0
votes
0answers
16 views

Negative binomial mixed effect model for repeated measures with R - prediction and plotting

I have a dataset to analyze in which a response was recorded at the ends of months 1,3,4,5,6 in 187 patients. All patients had the responses recorded in each week, and all patients started a treatment ...
0
votes
1answer
9 views

Random Coefficient Negative Binomial Model

I have a crash count data and i want to build a random coefficient negative binomial model in R. The dependent variable will be the crash counts and covariates will be Lane width, AADT, shoulder width ...
3
votes
2answers
175 views

Packages or libraries for multiple-output learning

I have a learning problem from $X$ to $Y$ where: $X$ = $n$ input numeric vectors of $m$ dimensions $Y$ = $n$ output numeric vectors of $k$ dimensions In other words:       I am ...
0
votes
0answers
9 views

Jackknife estimator for coefficient of variation

I have one of the estimator of coefficient of variation and i am using jackknife method to reduce bias. I am running R code to do the simulation for this study. The result i am getting is not what i ...
1
vote
0answers
21 views

Different variance estimator for multilevel ordinal logistic regression in Stata and R

I estimate a multilevel ordinal logistic regression models in Stata and R, and receive different estimators for the variance and the covariance of the latent variable of the higher level. Among other ...
3
votes
1answer
60 views

Justification for default contr.poly() polynomial contrasts in R

In R, one can use contr.poly() to create a set of orthogonal contrast codes for testing linear and higher order effects of categorical factors: ...
0
votes
0answers
13 views

Can I use deviance to compare the fit of a model to different datasets?

I'm using R's nls to fit different datasets to the same model. I've read that using R-squared is usually not correct for ...
0
votes
0answers
10 views

How does the “summary” function that is run on a principal fitted components function work?

I'm playing around with the ldr package in R, which comes with Big Mac data. If I run this code (which is similar to one of the examples): ...
1
vote
0answers
19 views

Fitting an envelope to x-y data in R

I have some data that I'd like to create an envelope for it. As in the picture, the data is always positive and I'm looking for something that will capture my crudely hand drawn red line. It should ...
8
votes
0answers
76 views

How to calculate prediction intervals for LOESS?

I have some data that I fitted using a LOESS model in R, giving me this: The data has one predictor and one response, and it is heteroscedastic. I also added confidence intervals. The problem is ...
0
votes
0answers
9 views

R and fisher test in each row in a data frame [on hold]

![enter image description here][1] I basically have this dataframe and I would like to do a fisher test on it to see which of thoses elements are present more ...
0
votes
0answers
9 views

skip -9999 and perform multiple regression [on hold]

I want to do the multiple regression where SMDI is my dependent variable and other are my independent variable. I have following dataset to do the multiple regression: SMDI ET PRCP ET_Ch ...
0
votes
1answer
68 views

How do I compare date-ranges from a time series?

I have a time series which contains monthly readings for air pollution in a city. The seasonality from this time series has been removed. Given two date ranges, for example Jan-Aug 2008 and Jan-Aug ...
2
votes
1answer
34 views

Implementing Gibbs sampler in R from posterior distribution

I am referencing a follow-up idea from something I posted earlier (Zero-inflated Poisson and Gibbs sampling, proofs and sampling). I want to implement the Gibbs sampler, by generating a large ...
2
votes
1answer
111 views
1
vote
1answer
121 views

What does the parameter $\alpha$ do in the Jaccard method for binaryRatingsMatrix in R recommenderlab?

What is the role of the parameter 'alpha' in the recommenderlab R package's use of Jaccard method in the recommender model for ...
0
votes
0answers
7 views

generating a sequence of indicators based on variable boundaries in JAGS

Suppose I have a vector of indices 1:N, and data y[1], ..., y[N]. I have three variable center points in ...
0
votes
0answers
42 views

Assessing the need for random effects terms

During the model selection phase for mixed models, there are typically several possibilities to choose from; in fact, the number of possibilities is increasing in the number of covariates used. How ...
0
votes
1answer
24 views

Measuring impact of advertising on retail sales

I have a dataset of retail products which contains weekly sales for 12 different items in a single category. For each item, I have three dummy variables representing different types of advertising ...
0
votes
0answers
28 views

Poisson Distribution - rpois - NAs produced [on hold]

I am new to R (a student) and running a Poisson distribution on football scores. head(results0910) works perfectly, showing me that my teams and scores are read in ...
2
votes
2answers
51 views

kappa coefficient doesn't make sense

I am calculating Cohen's Kappa to assess agreement. Here is my contingency table: 0 1 0 23 17 1 59 457 So the observed probability of agreement is high ...
0
votes
2answers
18 views

Prediction of features given predictor

I am working on a problem where my objective is to predict y given some features x1,x2,x3,...x8,x9 I solved this problem using some statistical and machine learning techniques like regression, trees, ...
0
votes
0answers
39 views

Difficulty plotting regression in R

I am trying to plot a regression using plot() and keep getting the error message "Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' and 'y' lengths differ". ...
2
votes
0answers
27 views

Two-Way Repeated-Measure design with lme4

I would like to model a treatment effect in two different groups, controlled for some co-variates (like age and education), and I assume that a two-way repeated-measure Anova would be the right ...
0
votes
1answer
36 views

Resources for understanding meta-regression?

I'd like to learn more about the statistical techniques that one should use for a meta-regression. I'm interested in both general theory, as well as examining methodologies in R.