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

Interpreting conflicting results of repeated-measures ANOVA using different functions in R

I have run a repeated-measures ANOVA using the aov() function, Anova() function and lme() ...
1
vote
0answers
16 views

R: Export CrossTable to Latex [migrated]

Is there a way to export a CrossTable (from the gmodels package) to Latex? So if I do : ...
0
votes
0answers
8 views

Forecasting with a trained hidden markov model (using r?) [on hold]

if I have a trainned hidden markov model i.e. the transistion and emission probability matrix are known, how do I make a prediction of let say 2 or 4 time steps ahead? Thanks, Andrew
0
votes
1answer
16 views

Chi Square distribution with degree of freedom 3

For X following a Chi-square distribution with degree of freedom m = 3, I want to compute P(1 < X < 4) Would it be, ...
0
votes
0answers
5 views

r cluster analysis of neurons

I am trying to run a cluster analysis in R to determine which neurons are putative dopamine neurons. I am thinking about using a k means cluster analysis. Is there any cluster analysis that specifies ...
1
vote
0answers
26 views

interpreting PERMANOVA (adonis function) output?

I am trying to look at expression of some genes and relate the dist matrix (Sm) to a number of different factors that I collected on the individuals (e.g., litter size, licking behavior, group housing ...
0
votes
0answers
10 views

Fieller's Theorem Equation computation with R programming [on hold]

Given that this is a fairly common used theorem, I am hoping someone has already used the R programming Language and console to work with this equation. Having a limited understanding of the ...
0
votes
1answer
8 views

R glmnet - appropriate link function for log-loss

I have a 2 class classification problem that I'm trying to optimize the log-loss for (not ROC/AUC). I'm using the glmnet package in ...
0
votes
0answers
15 views

Coverage probability Poisson - R [on hold]

I am trying to figure out in R a graph that displays the coverage probability of the confidence intervals for a parameter of a Poisson. I am taking as benchmark paper Brown, Cai & Dasgupta (2003) ...
1
vote
2answers
3 views

How to interpret p-values in output of seqecmpgroup()?

The seqecmpgroup() function returns a table that, among other things, include p-values for each identified subsequence. How should these be interpreted? I can see ...
1
vote
0answers
19 views

Model formulation of mixed models: from R (nlme and gamm) syntax to mathematical

I have finalized two types of models, a linear mixed effects model and a generalized additive model for my data set. I have read and understood how it works and how to choose which model would be the ...
-1
votes
0answers
12 views

Quality measure k-means implementation in R [on hold]

I used a couple of methods to find the optimal number of clusters in k-means. From some research I found that people quite often use quality measures to deal with this problem. As I'm working with ...
0
votes
0answers
8 views

MINST Image Classifier in R: NaNs produced

I'm teaching myself to do image classification in R. I came across a great bit of code that employs K-Means and SVM to perform image classification (the code is available on GitHub) Feature ...
1
vote
1answer
51 views

Plot regression with interaction in R

I did a regression analysis with the following variables: Predictor = dummy variable, dependent Variable = metric, moderator variable = metric. I now want to show my results in a figure. The ...
0
votes
0answers
28 views

Can a Naive Bayes Model predict using pattern alone?

Say I have a set of data abc-def-ghi jkl-mno-pqr stu-vwx-yza and lots of other training samples which are catagorized as **names*. The above dataset does not have ...
0
votes
0answers
39 views

Transpose matrix [migrated]

I have a csv file with two colums transid and item. It has the following values ...
1
vote
1answer
23 views

simulating a multiple comparisons problem using R and bonferroni correction

I am actually working on an exercise for my students dealing with multiple comparisons. However, I was having trouble trying to simulate some data in R to demonstrate the problem with multiple ...
1
vote
0answers
22 views

Subject-specific graphics for repeated-measure design

I am doing linear mixed effect modelling testing the effect of treatment on pitch, with ...
0
votes
0answers
6 views

Can the rcorrp.cens paired concordance test be done taking into account strata?

Followup to these discussions: Bootstrapping Hmisc::rcorrp.cens for paired concordance? Stratified concordance index (survival::survConcordance) Is there a way to perform a stratified paired ...
1
vote
1answer
24 views

sample size of Anderson-Darling test

Why sample size of Anderson-Darling test for normality must be greater than 7? It is designed as above way in ad.test function of some packages in R. I want to test 5 samples data in normality test, ...
0
votes
0answers
15 views

Deep Learning Predictions Seem Off

I'm doing a linear regression using the h2o deep learning interface with R. I'm comparing the predictions to the ones I'm getting from the randomForest R module. The predictions from randomForest ...
0
votes
0answers
24 views

How do you fit a group level regression for a multilevel model using the lme4 package in R?

How do you fit a multilevel regression model in R where you want to include a group-level regression? I think that the answer is using STAN, but I've been trying to use lmer() from the lme4 package. ...
0
votes
0answers
45 views

Obtaining adjusted proportions with lme4, using the glmer-function

I aim to estimate the annual proportion of patients (% of patients) that are smokers in a population whose age and sex must be taken into account. In other words, I want to calculate the prevalence of ...
0
votes
0answers
7 views

Manipulate data that has multiple columns and set amount of rows to one that is like a database using R [on hold]

The headers are : user_id, response, impression_id, creative_id, timestamp. for some users, there is no impression_id, creative_id, or timestamp. that is ok. For other users there are multiple ...
0
votes
0answers
60 views

Explained variation ($R^2$) from MCMC glmm - Nakagawa & Schielzeth 2013

This is a follow up to a question I asked previously, where I suggested that variance-covariance matrices could be used to derive correlations, which are then usable as estimates of how much each ...
1
vote
0answers
13 views

Predictions using time dependent covariates in survival model [migrated]

Simple question, how do you specify time dependent covariates in the data.frame supplied to newdata when looking to make predictions? In other words, I fit a model ...
0
votes
1answer
24 views

How to apply an R prediction model to very big data from SQL database in parallel.

I dont need to load the entire dataset into memory. In fact I only need 1 row at a time to apply a trained model, get the predicted response and put that response somewhere, possibly back into another ...
1
vote
1answer
19 views

Significance codes in linear model with factors

I am setting up a linear model in R and need help understanding the significance codes when one of my independent variables is a factor - i.e., dummy variable for each possible value For a scalar ...
0
votes
0answers
23 views

Mclust function of mclust package overfitting gaussians

I'm using the Mclust function of the mclust package in R to fit a mixture of gaussians model. My simulated data obviously has 3 ...
0
votes
0answers
20 views

Problem in sum of vector [migrated]

I'm trying to do this : for(i in 1:5){ O[i]=sum(y[i:i+m-1])} m is an integer in [2,12]. But, in the output, I got for each ...
0
votes
0answers
37 views

Kernel Smoothing in R [on hold]

I am trying to apply a Kernel Smooth to data in a vector format, I run the following lines of code: ...
1
vote
1answer
46 views
3
votes
2answers
27 views

Association between two proportions using p-value

I have two proportions and I need to see if they are associated somehow. The null hypothesis is that they are equal. I'm using R. So I get the pooled proportion: ...
0
votes
0answers
17 views

question about using R to find cofindence interval for the subpopulation [on hold]

I am stucking on several statistic questions. I have no idea which direction should i go. Please help! The variables are x=height of father and y = height of corresponding son. The unit is centimetre ...
0
votes
0answers
13 views

How to build the A MAtrix for a A-Model(Amat) after a REDUCED VAR in R

i have a doubt in how to build the A MAtrix(Amat) for Estimating a SVAR model in R: I estimated a reduced VAR with the GDP, interest rate and inflation variables . With the economic theory and the ...
0
votes
1answer
60 views
1
vote
0answers
21 views

Minimizing 95% Confidence interval extent for bootstrapped confidence intervals

I'm new to CrossValidated so please excuse any shortcomings in my question. Suppose I have a sample of 500, for a population of 500,000. I asked my sample of 500 what day of the week they go grocery ...
1
vote
0answers
13 views

Correct df in longitudinal linear mixed model?

I am having trouble understanding how to correctly apply a linear mixed model to my data to measure the effect of wifi exposure. 4 beehives contained sensors collecting data on temperature (DHT22_t, ...
1
vote
0answers
10 views

Relationship between Gumbel and Weibull distribution, accelerated failure time models, and Survreg using R

I have three questions concerning accelerated failure time models (AFT), one statistical, one regarding how to implement these models in R, and one related to finding out information about what R is ...
1
vote
1answer
16 views

Elements of first list in Kendall must be ordered?

Two ways to execute a Kendall tau test (in R): ...
0
votes
1answer
29 views

Time series with multiple subjects and multiple variables in R

I'm having trouble finding a time series technique to deal with a data set I am working on. It contains multiple subjects and multiple variables, not all of which will likely be part of the time ...
0
votes
0answers
13 views

Forecast Error Variance Decomposition with restricted VAR model

For conducting Forecast Error Variance Decomposition (FEVD) on a restricted VAR model I use the fevd method in the package vars ...
0
votes
0answers
20 views

Obtaining adjusted proportions with logistic regression

Can I obtain adjusted proportions of a binary variable by using logistic regression? I have a binary variable (normal/abnormal), which I'd like to obtain adjusted prevalence for (i.e the proportion ...
1
vote
0answers
37 views

How to present multiple distributions with R?

I have a stochastic simulation on NetLogo in which my agents accumulate "wealth". Of course, every run gives me different outputs but with pretty much the same distribution. I use histograms to keep ...
0
votes
2answers
39 views

fitting a cubic polynomial to a trend component of time series

I have 295 observations of two variables, of which here are a few: ...
1
vote
1answer
27 views

using training data in final model output

I have customer data for around 400,000 customers where 270,000 of them are current customers and 130,000 of them are past customers who churned, what I am doing is classifying them as 0 (non-churn) ...
0
votes
0answers
6 views

More comprehensive summary() function in R? [migrated]

I was wondering if there was a more comprehensive summary() function in R that perhaps includes more model metrics such as confidence intervals around the estimates maybe log-likelihood, AIC, BIC ...
0
votes
0answers
17 views

Kolmogorov-Smirnov using R [migrated]

Long story short, I want to manually write the code for the Kolmogorov-Smirnov one-sample statistic instead of using ks.test() in R. From what I understand, the K-S test can be broken down into a ...
0
votes
1answer
41 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 ...
1
vote
1answer
17 views

biased random guess classification

I try to get used to some classification methods in R (kNN, Decision Trees, SVM) and I am just wondering: Is there a way to do a biased random guess classification to see the real performance of the ...