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

How to estimate ratio of variances?

Suppose we have two time series generated by $$ x_t = \sigma_t\,e_t \\ y_t = c\,\sigma_t\, f_t $$ where $e_t$ and $f_t$ are IIDs with mean zero and unit variance. We don't know much about $\sigma_t$ ...
1
vote
0answers
8 views

Testing 3-way interaction of categorical variables in a meta analysis in R

I'm currently working on a meta-analysis using the metafor package for R. I have several categorical moderators, a few of which are multi-category, that I'm including in the analyses. When using one ...
0
votes
0answers
14 views

What's wrong with my Dickey-fuller test in R?

I'm doing dickey-fuller test on Airplane data in R! I'm using "adf.test" in "tseries" package and also doing this test in SAS. But SAS calculates p-value 0.2 and R calculate p-value 0.01. Both ...
0
votes
0answers
4 views

McFadden pseudo R squared on GLM.NB

I have used the McFadden pseudo R squared on a negative binomial glm (family=poisson). I was wondering if it's appropriate. I have found informations suggesting McFadden is useful for poisson glm but ...
0
votes
0answers
12 views

Calculating Wishart PDF

I have a dataset that contains 1000 rows and 8 columns. How can I calculate the Wishart PDF for it? ...
0
votes
0answers
8 views

Bonferroni correction after hypergeometric test

I have a small doubt regarding a Bonferroni after running an hypergeometric test on genomic data. Let say I have a population of 379876 output data(integer numebers), and this population is clustered ...
1
vote
0answers
7 views

What is the appropriate statistical test to perform a difference of means within a difference of means?

Let's say I am interested in measuring the effect of three different types of interventions on test scores. Let's say the intervention is book quality, of which there are three kinds of book quality ...
1
vote
2answers
26 views

auto.arima not giving the best model according to information criteria

I'm using auto.arima to get the best model for the MASS dataset deaths. However, ...
0
votes
0answers
13 views

How do I compute the posterior distribution of the success probability with uniform priors?

This is a question from a homework assignment A clinical trial is conducted to compare the effectiveness of three drugs. 100 patients are randomly assigned to each drug (300 total patients), and Y_1 ...
0
votes
0answers
28 views

Statistics help required [on hold]

I am doing a project in A/B testing.I want statistical approach to evaluate my work. A/B testing is comparing two versions of a web page/ taglines /landing pages to see which one performs better. You ...
0
votes
0answers
20 views

How to fit a curve for a histogram [on hold]

I am trying to fit a curve (gaussian) for my distribution represented here with an histogram, like the red curve represented in the attached shema. X = rchisq(1000, df = 5) hist(X) Thank you
0
votes
0answers
5 views

Planned contrasts in ezANOVA

I have a data set that is 3 x 5 and I can easily run a repeated measures ANOVA using ezANOVA in R. I now wish to have planned contrasts going into the ANOVA. The data consists of one control ...
1
vote
1answer
41 views

Statistical significance in time series (R)

Stats newb here, I have to determine if two time series are really different instead of being part of the same population with noise in the samples. The data is a comparison between two algorithms ...
0
votes
1answer
12 views

SOM (Kohonen) using the term document matrix [on hold]

Language: R Package: kohonen Function: som I have a term document matrix (tdm) with 64 terms (row) and 1017 documents (columns). I want to use the self-organized-map to cluster the terms on 25 ...
0
votes
0answers
10 views

Filling a Matrix on the basis on data in two columns [on hold]

I have a following matrix M - A B C D A 0 0 0 0 B 0 0 0 0 C 0 0 0 0 D 0 0 0 0 and Data Frame - DF C_Name F_Name Sam A Sam D Sam C Tom C Tom ...
0
votes
0answers
2 views

How to incorporate intraspecific variation in discrete characters in comparative analysis?

I'd like to run a multivariate analysis (Pavoine et al. 2011) that aims to disentagle the effect of environmental gradients on traits, considering its autocorrelation with phylogeny and space. It uses ...
0
votes
0answers
16 views

Is there a variable selection function in R or Stata for Tweedie regression?

I have a data which includes 8 variables: 1- The first variable contains grades given by a voice expert to participants' voices. It takes any value from 0 to 3 with mode 0 (so zero inflated) 2- The ...
3
votes
0answers
46 views

How to analyze trend in non-periodic time series

Suppose I have following non-periodic time series. Obviously the trend is decreasing and I would like to prove it by some test (with p-value). I am unable to use classic linear regression due to ...
0
votes
0answers
11 views

Normalize sum(case when..) [on hold]

In Netezza I ran the following query to make the nominal variables into binomial ones and sum them up: sum(case when c.COUNTRYCODE = 'US' then 1 else 0 end) as US ...
0
votes
0answers
8 views

ordinal logistic regression with time series

At several time points, I sample different individuals from a population (say 60 ind/time point). I assign to each of them one category (either low < middle < high). I then want to model this ...
0
votes
0answers
9 views

Loss function selection for weighting errors differently

I am building a regression model where I want to score/optimize/train 'over-predictions' to be twice costly as under predictions. I am attempting to do this in R and hopefully with caret package. ...
1
vote
0answers
25 views

R Poisson process simulation for a queuing problem [on hold]

I'm working on the problem - patients come into a clinic according to a Poisson process with time parameter 10 minutes starting from 9 am until 4pm when the clinic stops admitting new patients. There ...
0
votes
0answers
16 views

Creating Naive Bayes Model for numerical data in R

I want to calculate the missing value using the NaiveBayes predictor. I am using a dataset with missing values at some rows, ...
0
votes
0answers
11 views

Predict function in r - time series

I have built a model on my training dataset where I have used the difference of the log(Y) i.e. diff(log(Y)) as my response variable. Now if I want to use this for predicting the Y variable in my ...
0
votes
0answers
18 views

Selecting Subset of Quantitative Variables in R [on hold]

Is there a way to generate a subset of my quantitative variables in R, without having to manually select them in the subset() command? I have very many quantitative variables, and it would be too time ...
1
vote
0answers
13 views

Optimal methods for bandwidth selection in kernel density estimation

I am looking for help in choosing a suitable method for bandwidth selection in kernel density estimation. I have six data sets with 50 to 200 observations each and aim to fit a continuous univariate ...
1
vote
0answers
21 views

Transformation of data with zero and R squared

I have a conceptual concern about data tranformation and R^2. Often we transform data to respect the assumption of the linear model. Therefore, we can use multiple type of transformation such as log ...
0
votes
0answers
18 views

Test for identifying structural breaks in daily financial time series data

I have daily data of Nifty from 2002 Jan 08 to 2014 March 31. I am trying to identify structural breaks in my data. I shall be very thankful if anyone can guide me as to what test shall I apply to ...
0
votes
0answers
30 views

How to use LDA results for prediction? And how to assess model fit?

I am trying to understand how to interpret the results I get from LDA. Running from the iris dataset in R, I can see the discriminant coefficients are in the model and then I can plot the model to ...
0
votes
0answers
18 views

Seasonal Time Series Modeling in SPSS Modeler (or R) & ARIMA

I've got a question regarding ARIMA modeling. I am having a hard time to make to model out the seasonalities of my time series. The pictures below shows my tries in modeling. The topic is to ...
0
votes
0answers
13 views

Not complete repeated measurement for linear mixed effect model in R using na.omit

I have measured the effect of different stimulation types in a group of subjects and I am using linear mixed effect models in R to check the effect of each stimulation type. Let's say I have ...
0
votes
0answers
14 views

loop and bootstrap in glm [on hold]

I have an example data (datasim) with binary outcome, Y and independent variables X1 till X10. ...
0
votes
0answers
9 views

Combine multiple independent variables into one variable in a GLM/GAM/GAMLSS model

In the R package gamlss there is a function centiles that according to the documentation is ...
1
vote
0answers
18 views

Setting column classes and defining any factor levels, without using loops in R [migrated]

I have been grappling with the following problem for a while, as I need to load in, manipulate, and produce scores from new datasets as quickly as possible. I have defined a data dictionary ...
3
votes
0answers
13 views

Generalized additive model

I need help on how to interpret results for Generalised Additive Models(GAM) in R using the mgcv package. I have a dataset called flood which has a dependent variable called year (1985-2014) and the ...
0
votes
1answer
41 views

A question on cosine similarity & k-means

I used the following code to perform clustering of a dataset in R. distMatrix1 <- dist(sample2, method="cosine") km<-kmeans(distMatrix1,3) I have got some ...
0
votes
0answers
26 views

Minimum Spanning Tree in R (vegan): managing identical values

In R the package "vegan" contains the function spantree. It takes a matrix of distances among terms and it creates a tree with all the points... unless two or more rows (ex: A, B, C) are identical. ...
0
votes
0answers
17 views

High survival probabilities for un-censored test observations when using RandomForestSRC

The survival probabilities when using the RandomForestSRC package are consistently very high for near-term time intervals. I would have assumed that the survival probability at least for those ...
0
votes
0answers
24 views

Rejection Sampling Not Giving Correct Distribution

I hope someone can check through all my steps to see where I made a mistake: I wish to create a sample with the density $\ f(x)=\frac{1-x}{(π-2)(x + 1)√x}$ using the [1,0] uniform distribution U, and ...
0
votes
0answers
3 views

Dividing lsmeans$constrasts output [migrated]

I'm trying to merge from Sigmaplot to R, and I'm getting some progress in reaching the same outputs. In Sigmaplot I use the Holm-Sidak correction, and that is the one which I am trying to achieve in R ...
1
vote
0answers
31 views

Splitting between train/test for customer churn survival models

I am a bit confused on how data can be split between train/test and "live" data for predicting churn using survival models such as the one in RandomForestSRC package. Goal of the model is to predict ...
0
votes
0answers
24 views

Error message in a nested Mixed Model in lme4

I'm trying to model the effect of a biomarker, Pentraxin3 on another biomarker, IL6 in a mixed model to account for correlations between the repeated measures and for correlations between the ...
0
votes
1answer
51 views

Model selection for and forecasting of arctic oscillation (a seasonal time series)

I'm having a doubt with a time series. I have to find the best model for it and use it to do some forecast. The data are about the arctic oscillation (AO) from 1950 to 2015. The series is clearly ...
0
votes
0answers
11 views

R darch : deep neural net pre-training

I'm trying to train a (not even deep) network on iris using the darch package. It works well as a standard backprop-net, but becomes bad as soon as I add a little pre-training: ...
0
votes
1answer
33 views

Alternative to beta regression

In the data that I am working on, my response is a proportion ranging between 0 and 1. I learnt that beta regression is probably the best choice to model such data, but is there a suitable alternative ...
1
vote
1answer
37 views

Metafor package in R: meta regression and scatter plot

I am doing a meta-regression with metafor package in R. The mixed-effect model for proportion is used to assess the linearity between study performed year and medication prevalence. Here below is my ...
0
votes
0answers
8 views

Add a legend on package darts [on hold]

I'm a student of statistic master degree of Padua. I'm finishing my thesi on models of darts. I've a speed question, Who Can help me? With this package you estimate the variance of dart's throw for ...
0
votes
0answers
10 views

Improve ctr for recommender system

I work in internet advertising company and the task is to increase ctr. I have different variables, such as amounts of clicks, user location, browser, os, his previous history etc. What are possible ...
2
votes
0answers
27 views

One to one exact matching in R [on hold]

I'm attempting one-to-one exact matching in R. That is, I have 60,000 treatment observations and 200,000 control observations but I only want 60,000 control observations and I want those to be matched ...
1
vote
1answer
18 views

Interpreting the residuals vs. fitted values plot for logit GLMM?

What I have is a generalized linear mixed model of the log OR of a rater (random effect) giving a response above a certain level on an ordinal scale, given a specification of what the rater was ...