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

14
votes
0answers
402 views

In a multi-level model, what are the practical implications of estimating versus not-estimating random effect correlation parameters?

In a multi-level model, what are the practical and interpretation-related implications of estimating versus not-estimating random effect correlation parameters? The practical reason for asking this ...
9
votes
0answers
234 views

Does a median-unbiased estimator minimize mean absolute deviance?

This is a follow-up but also a different question of my previous one. I read on wikipedia that " A median-unbiased estimator minimizes the risk with respect to the absolute-deviation loss function, ...
9
votes
0answers
3k views

How to estimate variance components with lmer for models with random effects and compare them with lme results

I performed an experiment where I raised different families coming from two different source populations, where each family was split up into a different treatments. After the experiment I measured ...
7
votes
0answers
153 views

p-value adjustment for Local Moran's I statistic (LISA)

I'm working with some exploratory spatial analysis in R using spdep package. I came across an option to adjust p-values of local indicators of spatial association (LISA) calculated using ...
7
votes
0answers
1k views

R and EViews differences in AR(1) estimates

The main problem is: I cannot obtain similar parameter estimates with EViews and R. For reasons I do not know myself, I need to estimate parameters for certain data using EViews. This is done by ...
7
votes
0answers
256 views

What are the options in proportional hazard regression model when Schoenfeld residuals are not good?

I am doing a Cox proportional hazards regression in R using coxph, which includes many variables. The Martingale residuals look great, and the Schoenfeld residuals ...
7
votes
0answers
1k views

How to analyze longitudinal count data: accounting for temporal autocorrelation in GLMM?

Hello statistical gurus and R programming wizards, I am interested in modeling animal captures as a function of environmental conditions and day of the year. As part of another study, I have counts ...
7
votes
0answers
1k views

Split-split-plot design and lme

I’m working on a data set in order to evaluate the impact of drying on sediment microbial activities. The objective is to determine if the impact of drying varies among sediment types and/or depth ...
6
votes
0answers
575 views

What does the anova() command do with a lmer model object?

Hopefully this is a question that someone here can answer for me on the nature of decomposing sums of squares from a mixed-effects model fit with lmer (from the ...
6
votes
0answers
427 views

simple repeated measures syntax - lme vs. lmer

I'm trying to look for significant effects on "similarity" (of "isinpair" and controlling for time effects) using repeated measures with an in group sample. The intervention "isinpair" occurs after a ...
6
votes
0answers
251 views

Can these data be aggregated into a proportion for a binomial glm?

We asked 60 people to list as many restaurant franchises in Atlanta as they could. The overall list included over 70 restaurants, but we eliminated those that were mentioned by fewer than 10% of the ...
6
votes
0answers
359 views

Mean comparisons following multiple imputation

I need to do some simple mean comparisons between groups (basic ANOVA F-tests) on data with missing values. I use the mice package in R for multiple imputation, but I can only pool results for the ...
6
votes
0answers
312 views

Modeling a spline over time — design matrix and survey of approaches

A response variable y is a nonlinear function of a number of predictor variables X (in my real data the response is binomially distributed, but here I'm using a normally-distributed value for ...
6
votes
0answers
211 views

Regularization $L_1$ norm and $L_2$ norm empirical study

There are many methods to perform regularization -- $L_0$, $L_1$, and $L_2$ norm based regularization for example. According to Friedman Hastie & Tibsharani, the best regularizer depends on the ...
6
votes
0answers
359 views

Testing for a significant difference between ML estimates: Likelihood ratio or Wald test?

I am trying to test whether or not there is a significant difference between maximum likelihood estimates of two genetic parameters (selection and dominance) across two environments with genotype data ...
5
votes
0answers
100 views

Demonstrate difference in growth over time

Short version Is there a difference per treatment given time and this dataset? Or if the difference we're trying to demonstrate is important, what's the best method we have for teasing this out? ...
5
votes
0answers
191 views

Failing at linear regression / prediction on a real data set

I have a data set on which I'm trying to do regression, and failing. The situation: Thousands of battle robot operators are fighting battles among each other using battle robots. Some battle robots ...
5
votes
0answers
71 views

Compressed sensing: Optimization in $L_1$ norm and total variation with fourier coefficients

I'm reading the article Robust Uncertainty Principles: Exact Signal Reconstruction from Highly Incomplete Frequency Information (Candes, Romberg and Tao, 2004). In this article they are talking ...
5
votes
0answers
57 views

Standard errors from flexsurvreg

I'm using the flexsurv package (in R) to fit an exponential distribution to the veteran ...
5
votes
0answers
108 views

Getting the prediction standard error from a natural spline fit

I'm fitting a natural spline fit to some data points. I'd like to estimate the prediction error for the predicted value. In linear regression (I agree that natural spline is also a linear regression ...
5
votes
0answers
54 views

Territories from observations

I have a number of animal observations, and want to deduce the number of territories (i.e. the number of individual animals) from this. More formally, the problem can be stated as follows: Each ...
5
votes
0answers
169 views

Stuck at analyzing large and complex data set

I've got an extremely large and complex dataset and getting frustrated with the analysis. In essence, my target question is a simple one. I am comparing insect flower visitation on >30 plant types. ...
5
votes
0answers
218 views

Which model for panel data with dependent variables from [0,1]?

I'm stuck with a regression modeling problem. I have panel data where the dependent variable is a probability. Below is an excerpt from my data. The complete panel covers more countries and years, ...
5
votes
0answers
871 views

Unable to fit negative binomial regression in R (attempting to replicate published results)

Attempting to replicate the results from the recently published article, Aghion, Philippe, John Van Reenen, and Luigi Zingales. 2013. "Innovation and Institutional Ownership." American Economic ...
5
votes
0answers
345 views

Stationarity tests for time series

I am currently working on time series modeling, especially on stationarity tests. For this purpose, I am extensively using Pfaff's book "Analysis of integrated and cointegrated time series with R" and ...
5
votes
0answers
289 views

The role of scale parameter in GEE

I am learning the generalized estimating equations (GEE) and the geepack R package. There are some questions that I am a little confused. In a GEE-constructed ...
5
votes
0answers
414 views

How to interpret coefficients of a multivariate mixed model in lme4 without overall intercept?

I'm trying to fit a multivariate (i.e., multiple response) mixed model in R. Aside from the ASReml-r and ...
5
votes
0answers
1k views

Choosing complexity parameter in CART

In the rpart() routine to create CART models, you specify the complexity parameter to which you want to prune your tree. I have seen two different recommendations for choosing the complexity ...
5
votes
0answers
573 views

How to compute confidence interval in ANOVA with repeated measures?

I made a model using repeated measures univariate ANOVA in R. ...
5
votes
0answers
191 views

Average Structural Function Calculation

EDIT: I have solved this problem myself. The problem with the simulation below is that the omitted variable should not be included in the 'true model'. I have written a blog post with a more detailed ...
5
votes
0answers
333 views

Asynchronous (irregular) Time Series Analysis

I am trying to analyze the lead-lag between time series of two stock prices. In regular time series analysis, we can do Cross Correlaton, VECM (Granger Causality). However how does one handle the ...
5
votes
0answers
379 views

Kaplan-Meier multiple group comparisons

Lets say I have the following data frame ...
5
votes
0answers
198 views

Regression line envelope from Census ACS data

Context: I’m working with the Census Bureau’s American Community Survey (ACS) data which are samples (not complete enumerations) aggregated at different spatial scales. Each ACS estimate is provided ...
5
votes
0answers
431 views

Propagation of uncertainty/standard deviations in biological experiments

I am trying to work out how to propagate standard deviations in a biological experiment, but I have some difficulties. I have the following (semi)fictitious data originating from an image analysis ...
5
votes
0answers
185 views

Tree size in gradient tree boosting

Gradient tree boosting as proposed by Friedman uses decision trees with J terminal nodes (=leaves) as base learners. There are a number of ways to grow a tree with ...
5
votes
0answers
298 views

Fitting a special mixed model in R - alternatives to optim()

I would like to do something in R that SAS can do using SAS's proc mixed (there is some way to do in STATA es well), namely fitting the so called Bivariate model from Reitsma et al (2005). This model ...
5
votes
0answers
277 views

Canonical correlation analysis on a MICE data set

I am looking to do a canonical correlations analysis (CCA) in R, using the CCA package, on a multiply imputed dataset (obtained from the mice package). I know that ...
5
votes
0answers
94 views

Is there an equivalent of ARMA for rank correlation?

Hi I am looking at extremely non linear data for which the ARMA/ARIMA models do not work well. Though, I see some autocorrelation, and I suspect to have better results for non linear autocorrelation. ...
4
votes
0answers
24 views

R packages that work with biased samples

I'm working with a biased sample of web users. I'm only able to track responses of users who have navigated my site in a certain way, and I'd like to run an analysis to determine how certain factors ...
4
votes
0answers
50 views

Compute and graph the LDA decision boundary

I saw an LDA plot with decision boundaries from The Elements of Statistical Learning: I understand that data are projected onto a lower-dimensional subspace. However, I would like to know how we get ...
4
votes
0answers
32 views

How to create a multivariate Brownian Bridge

It is known, that a standard multivariate Brownian bridge $ y(\mathbf u) $ is a centered Gaussian process with covariance function $$ \mathbb E(y(\mathbf u) y(\mathbf v)) = \prod_{j=1}^d (u_j \wedge ...
4
votes
0answers
88 views

Compute Shannon entropy between every row of a large, sparse matrix

I have a sparse, binary matrix of user (rows) and items (columns). Each element of this matrix is either 0 or 1: ...
4
votes
0answers
96 views

How to fit log-linear poisson autoregressive mixed model?

I have time-series count data $N_{i,j}$ (population sizes in site $i$ and year $j$) and I want to correlate year-to-year changes with the environmental conditions $x_{i,j}$. For this, I want to fit ...
4
votes
0answers
76 views

Meaning of a convergence warning in glmer

I am using the glmer function from the lme4 package in R, and I'm using the bobyqa optimizer ...
4
votes
0answers
60 views

comparing AIC and adjusted $R^2$

So, I have a homework assignment in which I'm being asked to compare the fit of two similar models by comparing their $R^2$ and AIC. Both models were run in R, one using the ...
4
votes
0answers
63 views

finding position by regression fit

I try to estimate an underfloor pipe position based on a temperature distribution on a surface of the floor. I know there is the pipe emitting a hot temperature all way along. I can measure a ...
4
votes
0answers
44 views

How do I model the probability of two empirical distributions?

I have two distributions: A, and B. Each distribution is filled with the numbers 1.0-10.0. These distributions are NOT simple functions, like the gaussian, but are merely empirical counts. ...
4
votes
0answers
124 views

Lasso on Negative Binomial Regression Model

Is there anyway that I can perform LASSO with Negative Binomial Regression on R? I am performing a negative binomial regression on my dataset because the data are too dispersed to impose poisson ...
4
votes
0answers
90 views

What analyses do I need to run?

Long post. Question at the bottom. My data look likes this: It consists of the test set accuracies of a series of 50 models formed on training sets. Using random sampling of the raw ...
4
votes
0answers
68 views

Contrast matrix definition

What exactly is contrast matrix and how exactly is contrast matrix specified? I.e. what are columns, what are rows, what are the constraints on that matrix and what does number in column ...