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 program in `R`.

learn more… | top users | synonyms

0
votes
0answers
17 views

Model failed to converge

I'm doing a variable selection for the interaction gender:type2 now ...
2
votes
1answer
23 views

Recommendation: Fast algorithm for logistic random effects?

What is the fastest algorithm for fitting a simple logistic 'random effects' type model, with only one level of categorical predictors? Another way of putting it might be a logistic regression with ...
0
votes
1answer
18 views

Classification Algorithms

Rather than due a google search and hope to find "the best" or an exhaustive list of classification algorithms I thought it might be easier to pose my questions here, and then get advice from you ...
0
votes
0answers
6 views

How to keep modified/downloaded package [migrated]

R noobie here. I'm am trying to use a package that I download off of github using source_gist, but it appears that I need to re-download it every time I quit R ...
0
votes
0answers
23 views

Why does NSDIFFS (R forecast package) never show seasonality? [migrated]

I've been using the EViews statconn DCOM interface to loop a large number of series from FRED through the nsdiffs(test=c("ch")) function in the forecast package of R to examine what percent of them ...
0
votes
1answer
29 views

Is high AIC a bad feature of the model?

I have a model with AIC equal to 78 809. Does this mean this is a very bad model or the intepretation should be different? There are 15 variables, 2-level response variable and 40 000 rows. ...
0
votes
0answers
6 views

Poisson glm overdispersion. Calculating QAICc for model comparison

I'm having some difficulties with my glm . The models are overdispersed so I want to run them as quasipoisson. I would like to be able to compare the models using QAICc but the packages I have ...
0
votes
0answers
16 views

Forcing the order of variable in a decision tree in R [migrated]

I would like to build a decision tree in R. Is there a function or workaround, to specify the order of the variables in the tree? For example if A, B and C are inputs I would like to say: split first ...
0
votes
0answers
15 views

Auto-correlation vs. number of observation periods

I've just read an excellent post mix model I've a question connected to that. Roland, can you recommend any reference to a comment that if one have not enough observation periods then it is ...
1
vote
1answer
41 views

Learner in R to predict data from a complex function: if a>b then a*b else a+b

What sort of general purpose learner could learn the data generated by the following function: if a>b then a*b else a+b or something of that sort of complexity. Ideally something general enough to be ...
1
vote
0answers
11 views

R function equal to excel CHIINV [migrated]

I'm looking for a function which do the same thing as excel's CHIINV. From Microsoft documentation, the definition of CHIINV is Returns the inverse of the right-tailed probability of the chi-squared ...
4
votes
2answers
59 views

What information, if any, can I extract from this scattermatrix?

I'm playing around with the breast cancer dataset and created a scatterplot of all attributes to get an idea for which ones have the most effect on predicting the class ...
0
votes
0answers
17 views

What type of post hoc test does a LME use by default?

I need to know what type of post hoc test a LME model is using in R, by default? Is it Tukey? And is the alpha modified?
0
votes
0answers
8 views

Diference between glm and bigglm estimates

How does bigglm function in biglm package work for logistic regression? I thought that it is not possible to calculate LR on chunks of data and then merge results. Will glm and bigglm yield ...
0
votes
1answer
24 views

Importance of McNemar test in caret::confusionMatrix

There are many metrics to evaluate the performance of predictive model. Many of these appear relatively straightforward to me (e.g. Accuracy, Kappa, AUC-ROC, etc.) but I am uncertain regarding the ...
0
votes
0answers
13 views

Can a factor be used as Y variable? Best test? [duplicate]

I have many plant populations of the same species sampled (around 100). What is measured is an allele on one gene, that can be A,B or C. This is what I would like to use as Y variable. Then I have the ...
0
votes
0answers
16 views

Using the Hotelling package in R

I have two samples of data in $\mathbb{R}^2$, assumed drawn from a gaussian distribution, and I would like to test whether the two samples have the same mean. I know that the right test to do this is ...
0
votes
0answers
11 views

Different quantiles of a fitted GPD in different R packages?

I am performing an extreme value analysis for meteorological data, to be precise for precipitation data available in mm/d. I am using a threshold excess approach for estimating the parameters of a ...
1
vote
0answers
30 views

Warning message: Model is nearly unidentifiable: very large eigenvalue

I am very new to R. I am using R Studio 3.1.2 for windows. I am trying to run the following analysis on some data about geese behaviour at different sites over time. I have managed to get the model ...
0
votes
0answers
15 views

How to select GLM model and account for sampling time? [duplicate]

I'm trying to detect relationships between species abundances (counts) and time (years) for many species using either Negative Binomial or Poisson regressions (depending on degree of dispersion). ...
6
votes
1answer
24 views

When to use offset() in negative binomial/poisson GLMs in R

I'm trying to detect relationships between species abundances (counts) and time (years) for many species using either Negative Binomial or Poisson regressions (depending on degree of dispersion). ...
0
votes
0answers
6 views

raking in R (Post Stratification) [migrated]

I have used this code for raking for 58 dataset. It gives error when population strata is not present in the sample list and the codes stop to run. But I want to continue still they dont match ...
1
vote
0answers
12 views

Where does R store subset information in glm object? [migrated]

I'm trying to do some post-processing of a large number of glm models that I am working with, but I need to extract information about the data subset from the glm objects. As a toy example: ...
0
votes
0answers
16 views

Comparing 2 time series in R

I was wondering what kind of tests one would use to compare these two time series. The first data set(in percentages) are results from a weekly survey that asks a YES/NO question on whether someone ...
1
vote
0answers
26 views

Can you generate confidence intervals for time series ETS forecast components?

Suppose you fit a time series with the ets function from the forecast package in R: ...
1
vote
1answer
16 views

How to find the cause of defect in a process

Suppose a product A undergoes a certain process. This product A is produced at a rate of 8000 per month and out of those in 75 cases defects are generated. In the data set, I have rows corresponding ...
0
votes
1answer
26 views

Plot that shows which attribute has the most effect on class?

I'm playing around with two datasets: Mushrooms and Breast Cancer. I'm trying to form a hypothesis of which attribute would have the most effect on the class when making predictions about the class. ...
0
votes
0answers
14 views

Is there a non-parametric repeated measures test for replicated block data?

Following on from an earlier question, I've got another question about comparing machine learning classifiers on various datasets. From the response to that question, and also to this paper I ...
0
votes
0answers
15 views

Unsuccessful ML estimation of a modified Weibull model's parameters

I'm running this code in R to find the ML estimators of a modified Weibull model. ...
0
votes
0answers
12 views

Log returns and ARMA-GARCH models

I try to model currency rates volatility using GARCH models through the RUGARCH package in R. Starting from the observed currency rate series, I compute the log-return through: ...
0
votes
0answers
63 views

How to calculate probabilities based on cumulative of time series?

I am trying to do predictions on plant growth based on cumulative of time series data. Unfortunately I am not a statistician, just a programmer tasked with writing the application that does this (PHP ...
1
vote
1answer
25 views

Calculating spline curve with custom knot positions

I want to fit a spline curve to a simple dataset in R featuring a single custom knot, and extract the resulting models. The data is: ...
0
votes
0answers
10 views

Variable selection prior to including second order effects?

Suppose I have a data set with a lot of predictors and I would like to do lm to determine the main effects. Suppose further that I want to consider quadratic effects. Of course one cannot just ...
0
votes
1answer
30 views

Recommenderlab - Getting the user_id out the RealRatingMatrix containing UBCF recommendations

I'm trying to use recommenderlab (with RSTUDIO) to get recommendations.When I'm using UBCF I can't extract the user id out of the realRatingMatrix containing the predictions, although I can do it with ...
0
votes
0answers
41 views

How to evaluate the optimal cutoff of ROC curve related to logistic regression using roc from the R package pROC?

I would like to get the optimal cutoff of an ROC curve relating to a logistic regression. I am using the roc from the R package pROC. I am assuming same cost of false negative and false positive using ...
0
votes
0answers
19 views

Transition probability matrix negative values of an M/M/C in R

I am trying to calculate a transition probability matrix of an M/M/C in R. The information given is the following : An IT support help desk represents a queuing system with five assistants taking ...
0
votes
0answers
23 views

Is my nested random-effect model non-hierarchical?

I have a problem with model structure because of the way factors are nested in a potentially non-hierarchical way. I'm not sure if I fully understand the issue but I can't find a way to specify the ...
0
votes
1answer
24 views

Modeling error structure in lmer in R?

Is it possible to add a parameter to lmer model which will be modeling the error structure? Sth similar to TOEP(X) and SP(POW) from SAS???
0
votes
1answer
19 views

From a normal distribution concerning tv rating to its profit distribution

I'm following a Quantitive Methods Course, we have been asked to solve 12 questions from an harvard business case concerning tv ratings. Intro: The questions: I've already answered the first 10 but ...
1
vote
1answer
15 views

Distance from hyperplane in SVM rbf kernel in R

I am running ksvm in R(using kernlab package) for a highly imbalanced data.Is there any way i can get the distance of my test data points(each of dimension 8-10) from the hyperplane?so that i can ...
0
votes
0answers
13 views

RandomGLM: data (responses) is not read as numeric [on hold]

I'm relatively new to R and I have a problem with randomGLM for prediction of a continuous variable. I read in four datasets which are comprised of a training ...
1
vote
0answers
21 views

Expected survival time from log-logistic survival model in R from survreg

I'm currently estimating a survival model (accelerated failure time model) with a log-logistic distribution in R using the survival package and the survreg function. I want to simulate expected ...
0
votes
0answers
15 views

Beta linear model

I wanted to learn more about the Beta linear model for data analysis. I was wondering if there were any good books out there to help code this model in R and to learn more about the Beta linear model. ...
0
votes
0answers
7 views

Fitting several growth models using grofit vrs nplr?

I have having a tough time fitting a a series of grow models to a fairly simple dataset. I'd like to fit several growth models and compare using AIC or some other model selection method. However I ...
0
votes
1answer
34 views

Cronbach's alpha in R

I am pretty new to Cronbach's Alpha, so I have a question about how to find it using R. As far as I am aware, Cronbach's alpha is a measure of internal consistency, but to use the alpha() function in ...
1
vote
1answer
26 views

Cohen's Kappa in R with no results

When I use the Cohen's Kappa coefficient to measure the inter-rater agreement between two rates, I cannot get the results. Here I provide a mock example to show the results. Please note that one rater ...
1
vote
0answers
10 views

Retaining variables in dcast in R [migrated]

I am using the dcast function in R to turn a long-format dataset into a wide-format dataset. I have an ID number, a categorical ...
10
votes
2answers
130 views

r-squared in quantile regression

I am using quantile regression to find predictors of 90th percentile of my data. I am doing this in R using the quantreg package. How can I determine $r^2$ for ...
0
votes
0answers
3 views

Calculating Model's Classification Accuracy in R [migrated]

I want to calculate the classification accuracy for a model I am fitting using glmer. Here is what I am doing: ...
0
votes
0answers
14 views

How to determine the random variable distribution to fit the generalized linear model in R? [on hold]

I have a trouble with a sample from a random variable. I cannot determine its distribution. I would like to calculate the generalized linear model then with this variable treated as the dependent ...