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
1answer
29 views

How to test multiple comparisons of means of variables in R

I have a multiple N (>20) variables. I want to test $H_0$ that in at least one pair of them one variable have significantly higher values then the other. I know that I can perform a bunch of $\frac{...
0
votes
0answers
14 views

How can I get R to give me a pearson stat on a poisson regression? [closed]

In particular the book I'm using shows it with the regression output, is this an old version or can I get R to do this too?
0
votes
0answers
18 views

Correlation between yearly store-sales and cross-sectional time series

I have a monthly time series data (for five years) on a particular store about its sales, marginal sales, inventory, etc. I also have monthly cross-sectional data (for five years) on the same. I ...
1
vote
0answers
25 views

Re-estimation of Hidden Markov Model Parameters without Knowing Hidden States

I have been working on Hidden Markov Models (HMM) for a while. I thought that I understood the basics of HMM, however, recently I have confused about a point. Here is the issue: Recall the 3rd ...
0
votes
0answers
12 views

Building a hierarchical classifier

I'm trying to build a hierarchical classifier on R. I know my data has a tree structure with a root node + 3 levels and that each node on a level has 10 nodes coming out of it. ...
1
vote
2answers
45 views

Agreement between two sets of continuous random variables of log-normal distribution

I have two sets of measurements from two different proxies (for simplicity we can assume one to be the gold standard). I want to report a number representing their agreement, ideally with 1.0 ...
1
vote
1answer
14 views

R: Visualizing accuracy (inter-rater) on continuous data

Please excuse my english, I'm not a native speaker. So I'm running a test-retest scenario to determine accuracy of my measurements of continuous data (angles [deg] and length [mm]). I've calculated "...
0
votes
1answer
39 views

Is it possible that a single neural network structure can solve multiple problems?

I am an enthusiast of neural network and regularly I try to model simple models in NN. While thinking about neural network's application in artificial intelligence I had this doubt arise in my mind ...
0
votes
0answers
15 views

Innovations algorithm in Matlab [migrated]

This seems like it's supposed to be a simple task but going through the "predict" documentation in Matlab I found this to look unnecessarily complicated so I could be looking in the wrong direction. ...
1
vote
0answers
20 views

glmmLasso Warning Messages [closed]

I am trying to run glmmLasso to estimate a mixed model with the command: glm1_final <- glmmLasso(Activity~Novelty + Valence + ROI, rnd = list(Subject=~1), data = KNov, lambda=lambda[opt],...
2
votes
0answers
31 views

Hosmer-Lemeshow test in R

The Hosmer-Lemeshow test is a statistical test for goodness of fit for logistic regression models. According to ?hoslem.test, it deals only with binary logistic ...
2
votes
0answers
19 views

Changing sensitivity (cval) in tsoutliers resulting in unexpected results

I am using the excellent tsoutliers R package to detect outliers (additive outliers, temporary changes etc.), but the cval ...
0
votes
1answer
16 views

MANOVA interaction effect wont compute

I am performing a MANOVA with a large multivariate dataset representing total body shape (dependent variable). My two independent variables are gender (sex) and cluster (from a previously computed ...
0
votes
0answers
11 views

How to use WeightedCluster::wcKMedoids to provide clustering for heatmap or heatmap.2 in R? [migrated]

TL;DR: How to use the WeightedCluster library (the wcKMedoids() method in particular) as input to ...
0
votes
0answers
8 views

Estimate the treatment effect in each level of a subgroup with Cox regression

People generate forest plots to determine the benefit of one treatment regimen over another through univariate hazard ratios. How do you generate them? Is there an R package that handles that? (This ...
0
votes
1answer
49 views

How to create a regression model if data points are structure as seen in the graph?

This is a graph of revenues for different products with the Y-axis showing normalized revenues (mean of 3 and SD of 1) and X-axis is weeks. I need do a regression analysis of sorts on this data and am ...
2
votes
2answers
56 views

Calculating prediction variance from JAGS model of a bernoulli outcome in R

I have a model of a bernoulli random process I fit using JAGS via the rjags package in R. Here are some example data, as well as code to fit the given models in ...
0
votes
0answers
14 views

Ordinal Alpha Reliability: Is Re-Ranking Appropriate?

I'm a researcher currently based in New Delhi where I'm helping adapt and validate a psychometric questionnaire. For this I need help with fixing the error in calculating ordinal alpha in R using the ...
0
votes
0answers
5 views

Orthogonal projection onto additive subspace (normal linear model)

It is known that in a normal linear model $X \sim N(\xi, \sigma^2 I) \in \mathbb{R}^N$, if we group our observations using a factor $F$, i.e we claim that $\xi$ lies in the subspace $L_F$ where ...
0
votes
0answers
10 views

What error distribution can I use for GLMM with continuous data but not normal due to too many 0s?

I am having problems with building a generalised linear model with random effects. I am modelling how a sensitivity ratio between various taxa and cyanobacteria (logSR) is effected by the taxa and ...
0
votes
0answers
43 views

multilevel model with categorical outcome in R?

I am examining social interaction data in individuals within two groups. Each social encounter has been coded to one of 4 categories, and these encounters are nested within individual, whom are nested ...
3
votes
1answer
50 views

Statistical test for random sample of data

I'm trying to determine if some particular measurements - in this case taken from a subset of genes of interest (50 genes) - show a significant difference to the rest of the population (15000 genes), ...
1
vote
0answers
17 views

paired t-test as a simple latent change score model

UPDATE: This problem was (embarrassingly) solved by specifying the intercept in the regression equation as shown below: ...
1
vote
3answers
26 views

Principal component analysis result

I'm trying to understand the result of PCA, thought you can help me to understand better. ...
0
votes
0answers
8 views

Separate duplicates of a data.frame into another data.frame [migrated]

I have a data.frame x, from which I want to put all duplicated rows in a new data frame z. My data frame looks like this: ...
0
votes
0answers
16 views

In R, making a probability distribution table [migrated]

In R, what is good way of creating a probability distribution table (that will be used for sampling)? Say I have the following probability distribution: ...
1
vote
0answers
25 views

Short-term power load forecasting with a neural network in R

I am working in applying neural network in short term power load forecasting. I have many load input variables and system load data as output variable but, I am confused how to use neural network time ...
3
votes
0answers
48 views

How to calculate prediction confidence intervals for estimated mixed model change scores varying per a continuous predictor, using “lme4” in R

The Setup I am employing a linear mixed model in R using the packages "lme4" and "lmerTest." In modeling my predicted variable, I have two time indicators set as fixed and random effects: one time ...
0
votes
0answers
13 views
3
votes
0answers
35 views

How should I include age in this mixed-effects model?

I've got repeated measures of hearing thresholds for a set of patients who each have a different inner ear measurement. This data is unbalanced, there are a varied number of measurements at varied ...
2
votes
1answer
34 views

Expected Value clarifications using R/Excel

So it has been a little while since I've taken my last statistics course, and I wanted to double check that I am not making any kind of grave errors in my expected value calculations. Quick bit of ...
0
votes
1answer
132 views

Gradient for logistic loss function

I would ask a question related to this one. I found an example of writing custom loss function for xgboost here: ...
0
votes
0answers
22 views

What error distribution can I use for GLMM

I am having problems with building a generalised linear model with random effects. I am modelling how a sensitivity ratio between various taxa and cyanobacteria (logSR) is effected by the taxa and ...
1
vote
0answers
25 views

How to describe this model

I have a study where subjects have received treatment to one eye, the other eye is untreated and is acting as a control. There are 3 measures (of retinal thickness) taken in each eye. The model I am ...
0
votes
0answers
8 views

What do the parameters of “frailty” function of R package “survival” mean

What do the methods "aic" and "df" mean in R package survival's function "frailty"? I can guess that aic somehow uses Akaike's information criterion (thus the name, duh), but how does it differ from ...
0
votes
0answers
23 views

Estimate quantiles by mixed model quantile regression

lqmm::lqmm returns a 95th percentile lower than the 90th, using the data and parameterization below. The goal is only to estimate these upper percentiles, accounting for any within-person dependency ...
2
votes
1answer
72 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
1answer
31 views

Wilcoxon Signed Rank vs Bootstrapping for Skewed Cost Data

I'm currently looking at non parametric cost data (highly skewed to the right), and I'm trying to compare cost data pre and post intervention. Traditionally I've been taught that due to the non ...
0
votes
0answers
3 views

[R-Language]How to store images in a directory in R? [migrated]

I'm trying to store multiple images whenever a user clicks on a button. Right now I have #Define path to store the images ...
0
votes
0answers
21 views

What's the difference between 'anova' and formulas?

If i want to test the additive (no interaction) hypothesis given some categorical factors, I can do it in two ways: Firstly, I have, in select "nice" cases, formulas that I can use to explicitly ...
0
votes
1answer
24 views

Significance of effects in analysis of ordinal data with cumulative link models

I'm trying to analyse some repeatead measurements where the "dependent" variable is ordinal. As far as I've understood the literature I've read so far the correct way to go is cumulative link mixed ...
0
votes
2answers
38 views

binary value in rcorr (spearman)

We study the acceptation of students to the university according to different criteria. The parameters x are quantitative values. The parametre y is binary value, it is the result, if the student is ...
0
votes
2answers
48 views

Removing highly correlated variables in logistic regression in r

I am developing a logistic regression model on a large dataset consisting of 15 variables and 200k observations. In initial model fitting, I find variables - "Purchase Frequency" and "Average Payment ...
0
votes
1answer
28 views

How does cross-validation in train (caret) precisely work?

I have read quite a number of posts on the caret package and I am specifically interested in the train function. However, I am not completely sure if I have understood correctly how the train function ...
1
vote
0answers
60 views

Forecasting revenue using Monte Carlo Simulation in R

I am trying to forecast revenue for a bank using Monte Carlo Simulation. Revenue is defined as- Revenue=A * B * C * D I am absolutely new to this method. From what I have read, I am planning to ...
0
votes
0answers
9 views

R Network - Color-code the nodes based on a separate vector [migrated]

I have a matrix B and a vector A (the matrix has value 0 or 1; the vector has value from 0 to 1 continuously; ...
0
votes
0answers
16 views

what is the meaning of covariates in ComBat

Can anyone tell me what the difference between the following code1 and code2 is? code1: ...
0
votes
0answers
4 views

Reverse the scale of the x axis in a plot [migrated]

I have created a plot in R and my own custom x and y axes. I would like the x axis to be displayed in a reverse order (1-0 by -.02). I have read numerous posts and threads that suggest using xlim and ...
7
votes
0answers
119 views

Writing out the mathematical equation for a multilevel mixed effects model

The CV Question I'm trying to give (a) detailed and concise mathematical representation(s) of a mixed effects model. I am using the lme4 package in R. What is the ...
0
votes
0answers
16 views

State space modelling of longitudinal data in r

I have n stations, and for each station there are m time series observations on different days, each of length ...