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
12 views

Does it makes sense to keep a 5-way interaction model?

I collected the following variables, as I thought they might be in some relationship, but without any strict hypothesis. Note: this is a repeated measures design. phy = continuous DV (a ...
1
vote
1answer
276 views

Time-dependent variable in survival analysis using R

I am conducting a retrospective study where I have a cohort of cases who underwent the same surgical procedure. The primary outcome of the study is the recurrence incidence rate during a follow up ...
0
votes
0answers
7 views

goodness of fit measure for quantile regression

What is a goodness of fit measure for quantile regression? I'm not too familiar with the theory but in R the AIC and log-likelihood are given in quantreg package. ...
2
votes
1answer
82 views

Expected number of cases, standardizing with age & sex of the whole population

Starting with a toy example data (http://www.stata-press.com/data/r14/hbp.dta) ...
1
vote
0answers
10 views

How to test differences in means in a population that is not normally distributed, heteroskedastic and differs in variance?

I want to test if the means of two populations are different from each other. There are 12 poulations, all with different sample size, ranging from 48.000 to 300. Here is a 20.000 rows sample. The ...
0
votes
1answer
202 views

Random forest clustering

In my data the classes were defined by binning a variable in 10 bins. After growing the random forest its proximity matrix is viewed as the following MDSplot: As can be seen from the plot all ...
-1
votes
0answers
8 views

R - pbkrtest, “Error : object ‘sigma’ is not exported by 'namespace:stats'” [on hold]

I get the following error message when trying to load pbktest: Error : object ‘sigma’ is not exported by 'namespace:stats' In addition: Warning messages: 1: package ‘pbkrtest’ was built under R ...
0
votes
0answers
8 views

Interpreting QLIKE and MSE Loss function (Patton 2011)

In Patton (2011) the author finds that both the MSE and the QLIKE loss function are robust when used to compare rivalling volatility forecasting models, which means that using a proxy for volatility ...
4
votes
1answer
2k views

Max Entropy Solver in R

I am trying to solve for the parameters in the maximum entropy problem in R using the nonlinear system: $\ \int_l^u e^{a+bx+cx^2}dx=1$ $\ \int_l^u x e^{a+bx+cx^2}dx=\mu$ $\ \int_l^u x^2 e^{a+bx+cx^...
0
votes
0answers
6 views

Zero-inflated model: non-finite value supplied by optim

So I have the following model predicting the presence of an animal on a certain spot. As a time unit quarter is initially used, but for one of the species of animals there is some (little) interesting ...
0
votes
0answers
3 views

Statistical Analysis on Multiple Group data

I am new in statistical analysis field. I have a dataset which is divided into five groups each with four columns(common in all five groups). All these five groups have a baseline group to be ...
1
vote
1answer
69 views

Using lme to perform a nested ANCOVA in r

I want to perform a nested ANCOVA using the function lme in r. My data concerns the growth rate (sgr) of fish at different temperatures (temp). In the trial there were 3 replicate tanks each housing 8 ...
0
votes
0answers
11 views

SMOTE length of 'dimnames' [2] not equal to array extent [on hold]

I was trying to supersample my dataset using SMOTE and i keep running into this error. ...
1
vote
1answer
31 views

How to compare ordered logistic nested models?

Let's say that I have a full and a restricted model that looks like this: ...
0
votes
0answers
9 views
0
votes
1answer
270 views

Can someone look at my method for fitting a GEE to my data?

I’ve been doing some statistical analyses in R on some data. It’s for use in a manuscript I’m hoping to get published in a biological journal. Unfortunately, the tests I ended up having to run are ...
2
votes
1answer
58 views

Why does this distribution look completely different after splitting into groups?

I've got some data that represents two groups, with a before and after result for both groups. When I plot the data together, it looks as though the after is much tighter around the mean. However, ...
0
votes
1answer
24 views

I'm using R to create a time series - having some difficulty understanding frequency

I'm working with a dataset of electrical submeter readings taken once per minute for 47 months. I'm trying to create a time series that covers meter readings from the kitchen during the week of ...
1
vote
0answers
62 views
+50

Robust M-estimator of location and dispersion by hand in R

I try to estimate a location and dispersion model with R, as described Maronna et al (2006, pp. 56). However, my estimate dispersion does not converge to the desired value. Do I have an error in the ...
0
votes
0answers
15 views

Time series object for hourly datat with daily seasonal in R

I have got hourly data from 2012.01.01 to 2016.06.13 and the data shows daily seasonal. I am trying to create a time series object with only daily seasonal in R. ...
0
votes
1answer
27 views

ARMAX or Dynamic Regression | regression of multiple timeseries

I have the following time series dataset (dependent | independent) : Sales | Income,Inflation, Interest Rates etc All of this is dynamic data pertaining to each ...
3
votes
0answers
9 views

Interpretation of glmmPQL() spatial autocorrelation output

I am modeling binominal data with random effects and spatial autocorrelation using MASS::glmmPQL(). Plotting the residual semivariogram of a model fit without ...
5
votes
2answers
182 views

More efficient way to create Block Toeplitz matrix in R? [on hold]

I am trying to create a Block Toeplitz matrix likes this: $\boldsymbol U = \begin{pmatrix} U(0) & U(1) & \cdots & U(n)\\ U(1)^T & U(0) & \cdots & U(n-1)\\ \vdots & \vdots &...
3
votes
0answers
62 views

Simulation of random-effects meta-analysis yields biased tau^2

I need to realistically simulate study effect sizes and within-study variances for a random-effects meta-analysis in which the outcome is a relative risk. My question: why does this simulation lead to ...
0
votes
0answers
21 views

Smooth hazard function at given knots in R

Is there a way to obtain a smooth estimate of the hazard function at specific x coordinates in R? My problem is related to functional data analysis where I have a number of hazard function estimates (...
7
votes
2answers
5k views

Relative variable importance with AIC

I am confused and just need some confirmation about calculating the relative variable importance value for the co-variates I used in AIC model selection procedures. I know that there is this one ...
0
votes
0answers
6 views

Treatment of Underflow from Log CDF Values in Rcpp [migrated]

I'm currently writing an R package using Rcpp, and need to evaluate a log-likelihood that utilizes a beta distribution. Depending on the size of the data (affecting the a and b parameters in the beta),...
0
votes
1answer
45 views

Two-way ANOVA unbalanced design: no matching results between R and GraphPad Prism

I'm getting some troubles in comparing results from ANOVA performed with Rstudio and ANOVA from the software GraphPad Prism. They don't match each other despite the same dataset. I have an ...
4
votes
2answers
475 views

Modeling prices with the Hedonic regression

I'm using the concept of Hedonic regression in order to model the prices for real estates. I'm having some trouble with my approach. What I have and what I do my data consists out of real estates ...
1
vote
0answers
12 views

interpretation output aov and contrasts

I have a question regarding an output interpretation. The model can be described as followed model <- lm(variable ~ p1*p2 , data = df) predictor 1 (p1) is ...
0
votes
0answers
19 views

Zero inflated GLM and singularities

So I am using a zero-inflated model to (1) model the presence/absence of an animal over certain habitat characteristics using a binomial distribution (2) model the count data over the same ...
0
votes
0answers
9 views

interpretation multilevel latent class output r

I am having some problem interpreting the output that I obtained from a multilevel latent class analysis conducted in R. I am not used to estimate this type of analysis in r and that is why I found ...
2
votes
1answer
59 views

Why Neural Network is Failing in a simple classification case

I have the code below where a simple rule based classification data set is formed: ...
1
vote
0answers
50 views

Latent Semantic Analysis- Theme extraction [closed]

I have a large collection of text documents I am trying to group using Singular Value Decomposition for dimension reduction(popularly known as LSA) followed by k-means clustering. To be able to ...
1
vote
0answers
20 views

Performing spatial logistic regression in R

I am trying to perform a logistic regression with the following code Y ~ x1+x2+x3,data=data, family=binomial(link="logit"). However on inspection of both ...
0
votes
1answer
31 views
2
votes
1answer
68 views

Running many multiple regressions at once in R

I want to run time series regressions (Fama-French three factor with my new factor). I have following tables. ...
0
votes
0answers
10 views

The Causal Impact Package in R plotting wrong data

I have this sample dataset which is as follow: head(data) ...
0
votes
0answers
13 views

Prediction Interval for Loess Forecast

I have consulted this question on the basis of prediction intervals for loess (How to calculate prediction intervals for LOESS?). However, I am unaware of whether it is proper or possible to use ...
0
votes
0answers
50 views

How can I assess variable importance for each individual observation?

So most regression models and data mining technique have ways to assess the importance of each variable in explaining the response. This is great, but how can I assess variable importance for each ...
0
votes
1answer
102 views

seasonality detection

I'd like to detect seasonality in my timeseries which consist of daily observation 96 per day,one for every 15 min, for a duration of 3 months. In the acf plot, I see a consistent 3 spikes, does ...
14
votes
2answers
18k views

Interpreting interaction terms in logit regression with categorical variables

I have data from a survey experiment in which respondents were randomly assigned to one of four groups: ...
1
vote
1answer
30 views

Tune parameters from a specific equation in R

This is the first time I am truing to tune model parameters in R. I have a fairly complicated equation with multiple parameters: ...
0
votes
1answer
675 views

Interaction terms and effect sizes in multiple regression

I know there are similar questions on here, but I can't quite find an answer that covers all of what I need. I am running multiple regression in r with two predictor variables and sometimes an ...
0
votes
1answer
140 views

pruning Neural Network

Since a feedforward NN with a logistic function as activation function is not linear, does it make sense to reduce variables first with principal components or discriminant analysis? Because shouldn'...
0
votes
0answers
25 views

Ordering by importance when plotting partial functions from forestFloor

I would like to start by saying that I am relatively new to the R packages randomForest and forestFloor and I have never posted a question on here - so bare with me. I have been working on an ...
1
vote
1answer
512 views

Simulate time to event times based on an existing subset of data

I have to task to predict data volume to be processed for a study that currently has 40 patients, but will have 100 patients eventually. Since most of the data is generated during the treatment phase, ...
1
vote
0answers
44 views

Best step pattern for unconstrained/subsequence DTW(Dynamic Time Warping)

I am implementing an unconstrained/subsequence DTW algorithm (in R). The query of data which I am trying to find a match within the reference data is much smaller (as compared to reference). I have ...