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

Approaches to high dimension pattern matching problem

My apologies in advance as I am new to this. I have searched the internet and tried various processes and nothing seems to work or address this situation. I have a dataset of 30,000 transactions and ...
1
vote
0answers
8 views

How to estimate the percent of the variation of a time series explained by another time series (non-stationary)?

I've been learning about time series analysis because I want to understand how much groundwater level changes in an aquifer affect land subsidence (land sinking). I have two time series: (1) ...
0
votes
0answers
5 views

How to make all interactions in R before using glmnet

I have an x-matrix of 8 columns. I want to run glmnet to do a lasso regression. I know I need to call: glmnet(x, y, family = "binomial", ...). However, how do I get x to consider all one way ...
0
votes
0answers
6 views

Using the confidence intervals to improve predictive model success rate

I'm trying to build a binomial predictive model based on glm. My overall prediction is very low, in the order of 60%. But when I go for the datapoints that have the both boundaries in one side, for ...
1
vote
1answer
38 views

Density plot of parameter estimates from linear regression model

I am running a linear regression model in R: data(iris) fit1.iris = lm(Sepal.Length ~ Petal.Length+Petal.Width , data=iris) summary(fit1.iris) These are my ...
1
vote
0answers
9 views

Is smooth.spline appropriate for presenting the trend of chemical concentration in a catchment

In my case,the Electrical Conductivity (EC) values are measured daily in some pints of catchment from 2007 to 2014, and around 20% data are missed, due to without probe or flux. To presenting the ...
1
vote
0answers
31 views

Multiple Imputation - Help Needed

These multiple imputation results relate to data I have previously described and shown here - Skewed Distributions for Logistic Regression Three variables I am using have missing data. Their names, ...
1
vote
0answers
20 views

R random forest on Amazon ec2 Error: cannot allocate vector of size 5.4 Gb [migrated]

I'm training random forest models in R using randomForest() with 1000 trees and data.frames with about 20 predictors and 600K rows. On my laptop everything works fine but when I move to amazon ec2 to ...
0
votes
0answers
23 views

Kruskal–Wallis non-parametric alternatives for groups with different shaped distributions

My question does't duplicate this question, even if the titles are nearly similar. The Kruskal–Wallis test "assume that the observations in each group come from populations with the same shape of ...
5
votes
2answers
137 views

Skewed Distributions for Logistic Regression

I have been developing a logistic regression model based on retrospective data from a national trauma database of head injury in the UK. The key outcome is 30 day mortality (denoted as ...
0
votes
0answers
6 views

Why will higher order of polynomials using poly() function solve in lme model and lower orders won't?

I am modeling repeated blood pressure data over 24-h (300 patients, 13,000 observations) and have fit the following model with 9th order polynomial which has solved: ...
0
votes
0answers
12 views

How to find rows of a given matrix that satisfy a certain property? [migrated]

Suppose that I have a 90x4 matrix, say matrixgroup1, and some of rows are zero vectors. I want to find the rows that are not zero vectors. The code that I try was: ...
0
votes
0answers
20 views

Model failed to converge

I'm doing a variable selection for the interaction gender:type2 now ...
2
votes
1answer
40 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 ...
1
vote
2answers
35 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
7 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
17 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
16 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
43 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
60 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
9 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
25 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
19 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
35 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
25 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
17 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
65 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: ...
3
votes
1answer
74 views

Monte carlo simulation in R

I am trying to solve the following exercise but I actually have no clue on how to start doing this. I've found some code in my book that looks like it but it's a completely different exercise and I ...
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
32 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
42 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
20 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 ...