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

1
vote
0answers
9 views

In R, generating every possible solution to a model, based on constraints [on hold]

In R, I’m trying to generate a matrix that shows results from a model and the values used to solve them- all of which are constrained. Every possible solution. An example model: Model= ...
0
votes
1answer
38 views

Resources for learning R with Statistics [duplicate]

Already read: Resources for learning R I would prefer to have a textbook which covers statistics with R, accessible to a beginning graduate student in statistics. Since I'm not as familiar with R as ...
3
votes
3answers
73 views

glm in R - which pvalue represents the goodness of fit of entire model?

I am running glms in R (generalised linear models). I thought I knew pvalues - until I saw that calling up a summary for a glm does not give you an overriding pvalue representative of the model as a ...
0
votes
1answer
32 views

glm in R - is the pvalue for Intercept important? Which pvalue represents the goodness of fit of entire model?

I am running glms in R (generalised linear models). I thought I knew pvalues - until I saw that calling up a summary for a glm does not give you an overriding pvalue representative of the model as a ...
-1
votes
0answers
21 views

How to use gpu in R in Windows 7? [on hold]

As I know, there are packages (like gputools, magma, HiPLARM, ...) for unix OS. Is it possible to use something like gputools in Windows 7? thanks!
-2
votes
0answers
24 views

How to calculate relative risk in R Studio? [migrated]

How to calculate relative risk in R Studio? In input i have names(DS) Tab<-table(DS[,5],DS[,11],DS[,3]) No Yes No 4 16 Yes 40 168 I am new in ...
0
votes
1answer
29 views

Generate correlated continuous and categorical data in R [on hold]

Task at hand: generate a simulated dataset containing both continuous and categorical variables, given a pre-defined correlation matrix. What has been done: this post covers how to generate ...
1
vote
1answer
24 views

Predicting the direction of moving a object in R

I am trying to produce a model that classify the direction of a moving object. In the figure we see a single projection of 3D space where an object was moved up and down (red) vs up and down together ...
1
vote
2answers
54 views

How to remove the outliers from a dataset? [on hold]

I have a dataset containing noise points. How can I remove lower and upper 1% data points using R?
3
votes
0answers
20 views

Fitting a glm to a zero inflated positive continuous response

I'm trying to fit R glm's to data sets where the response is zero inflated positive continuous. This is an example data set ...
0
votes
0answers
15 views

Machine learning algorithms for panel data

In this question - Is there a method for constructing decision trees that takes account of structured/hierarchical/multilevel predictors? - they mention a panel data method for trees. Are there ...
1
vote
1answer
43 views

SVM RBF performance on “dissimilar” data

I've been studying the performance of machine learning algorithms on "dissimilar" data (that is, prediction on new data that are not that "similar" to the training set) and I came up with this ...
1
vote
0answers
18 views

Generalized additive mixed model in R - specifying a fit function

The data in question comprise two response groups (no response vs. stress signal), different individuals, repeated measures ...
0
votes
0answers
6 views

Errorbars for barplot only in one direction in ggplot2 (R)? [migrated]

Is it possible to adjust errorbars in ggplot2 so that they are plotted only in one direction (e.g. only upwards but not downwards)? ...
0
votes
1answer
12 views

How to test a time series' serial correlation with ties in R?

I was trying to test serial correlation for a time series measurements (x1,x2,...xn). The problem is that some of them happens in the same date, the time points are ...
0
votes
0answers
25 views

Bootstrapped BCa confidence interval of median (R package simpleboot) does not correspond with Wilcox.test p value

I am using R to compare the medians of two groups. Each individual has received a score of between 0 and 100. Both distributions are very skewed. The median of group A (n=33) is 87.8 (IQR 75.1, 100.0) ...
0
votes
0answers
11 views

Meta analysis on multiple endpoints and unknown covariance

I am doing meta-analysis on intervention studies on human subjects where a number of measures were obtained before and after the intervention in a treatment and a control group. We categorize the ...
0
votes
0answers
28 views

modelling season in function of temperature and precipitation: which model to use? [on hold]

I have to model the 4 seasons on basis of temperature and precipitation. I have no idea which model to use. I'm a new R user and I've used only linear model and logistic regression till now. Is there ...
4
votes
1answer
23 views

Best practice for ADF/KPSS unit root testing sequence?

I've been quite confused by the various unit root testing strategies recommended in the literature, so I was hoping others may have some advice on the best way to proceed using ADF and KPSS tests. ...
1
vote
0answers
12 views

Approaches to high dimension pattern matching problem [migrated]

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 ...
2
votes
0answers
18 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
9 views

How to make all interactions in R before using glmnet [migrated]

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 ...
1
vote
0answers
20 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 ...
2
votes
2answers
68 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 ...
0
votes
1answer
21 views

Correlation between a numeric and factor in R [duplicate]

I'm new to R and I'm trying to find the correlation between a numeric variable and a factor one. I have a data frame with the following 3 columns: 1. nr of clicks (range 0:14) 2. response (1= "YES", ...
1
vote
0answers
11 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
45 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
25 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
148 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
9 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
23 views

Model failed to converge

I'm doing a variable selection for the interaction gender:type2 now ...
2
votes
1answer
52 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 ...
2
votes
2answers
38 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
8 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
18 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
64 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
4 views

Weighted Correlations in case of matrix in R

I'm trying to calculate weighted Pearson correlations in a big matrix (X), say column-wise. The problem is that the cor() command calculates unweighted ones and corr() from BOOT considers only one ...
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
20 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 ...