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

what is the relation between significance level and forecasting values

From the past data we estimated the future values in R with default level of significance but my doubt is if we increase or decrease the significance value then how much change will be there in ...
0
votes
1answer
14 views

r linear regression model mistakenly giving me r2 value of 1

I'm using R to create a linear regression model from survey data about public sentiment for a new technology. I am encountering a problem where the addition of a new explanatory variable raises the ...
0
votes
1answer
12 views

What is the proper way to do vector based linear regression in R

I want to do linear regression between vector inputs and vector output. That is each y is a vector with M components, and each x is a vector with N components and the answer should look like y ~ Ax + ...
0
votes
0answers
22 views

r linear regression mistakenly giving me r2 value of 1

I'm using R to create a linear regression model from survey data about public sentiment for a new technology. I am encountering a problem where the addition of a new explanatory variable raises the ...
0
votes
0answers
10 views

Random effect and within subjects effect in R

I have some data which has a within-subjects treatment factor and a between-subjects random factor. The design is fully balanced. I am relatively new to R, but I have used lm, aov, and ezANOVA on ...
0
votes
1answer
10 views

Test to determine correlation between organism size and concentration?

I have a gamma distribution. I am looking to determine if higher concentrations of a toxin are correlated to larger organism size. I think a non-parametric test would be best, but I'm not sure which ...
0
votes
0answers
5 views

Calculating 2 hourly average of data [migrated]

I have flow data for a year. I want to get the 2 hourly averages of the data and make a timeseries that records the average flow for the two hours along with the timestamp. The data look like this: ...
0
votes
0answers
11 views

Optimizing a time-series with multiple predictors

I have a few questions about turing a univariate time series into a multivariate time series and optimizing the predictors. Here is the univariate data: ...
1
vote
2answers
11 views

credible interval equivalent of confint() for bayesglm() in Gelman et al's 'arm' package?

How do I extract a credible interval ala confint on a glm object when working with the object returned by bayesglm() in arm?
0
votes
0answers
9 views

LCA not returning the same results with the same data

I'm pretty new to Latent class analysis, and I obviously still have a lot to learn. I have a data set with 10 000 observations and 20 variables. I'm trying plot the probabilities of each of my ...
0
votes
0answers
9 views

Why is MeanDecreaseGini over 1 in RandomForest package in R? [duplicate]

I am using R package randomForest, and calculated MeanDecreaseGini as below. ...
0
votes
0answers
2 views

How can I create multiple bar charts at once (in R)? [migrated]

I have a data set that includes Likert-type ratings of a bunch of around 20 measures. In my head I have an image of one long chart with 20 plots showing the distribution for each question. Using ...
0
votes
0answers
15 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
10 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
22 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
9 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
30 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
10 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
20 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) ...
2
votes
2answers
13 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
26 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
10 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 ...
0
votes
0answers
5 views

R power analysis pwr.f2.test

I'd like to run a power analysis for a repeated measures within-subject design. Most relevant is a 4 x 3 interaction. Can I use pwr.f2.test of the pwr package for the power analysis of this repeated ...
1
vote
1answer
56 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
31 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
24 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
24 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
12 views
+50

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
17 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
26 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. ...
1
vote
0answers
72 views
+50

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 adjusted ...
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
68 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
21 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
25 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
47 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
20 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
64 views
1
vote
0answers
24 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 ...