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

Comparing odds ratios - conditional or unconditional MLE

When comparing log(OR) from two contingency tables using Z-test should I use conditional maximum likelihood estimate of odds ratios (as given by fisher.test in R) or simple unconditional?
1
vote
1answer
31 views

Time-dependent variable in survival analysis using R

I am conducting a retrospective study where I have a cohort of cases who underwent the same surgical procedure. The primary outcome of the study is the recurrence incidence rate during a follow up ...
0
votes
0answers
23 views

Comparing the estimated coefficient in Logit versus Mix Logit, regarding the scale parameter

My question is how can I compare the estimated parameters for a logit model with a mixed logit model? I am using mlogitpackage in R and my code is as follows: ...
0
votes
3answers
57 views

how to calculate R-squared in glm?

I came up with below for my glm analysis but I need to calculate R-squared to cite in the paper? anyone can help me with this please? summary(lrfit) Call: ...
0
votes
1answer
25 views

Multi-class logistic Generalized Additive Models [closed]

I am looking for a package for three-class logit and probit GAM. I have searched and found out that ZeligGAM in R works for this but it seems that it is only applied to binary dependent variables. In ...
1
vote
0answers
31 views

Quantile of a conditional cumulative bivariate normal distribution and R Implementation

I would like to compute a quantile Z of a conditional cumulative bivariate normal distribution. I have two questions: 1) Do I formulate the problem correctly? 2) How would I compute this quantile Z ...
0
votes
1answer
14 views

recode function [closed]

Two sections of an introductory statistics class took a quiz. The highest possible regular score was 20. Some students got one point of extra credit from a bonus question. A passing grade is 60% or ...
0
votes
2answers
52 views

Building a regression Tree with R FROM SCRATCH

I am trying to build a basic regression Tree in R FROM SCRATCH (I know of rpart, tree, RandomForest,etc.). But it is just something that I would want to code myself for my culture. In terms of ...
1
vote
0answers
30 views

extremely high Cook's D & dfbetas results from influence.ME

I fit a mixed effects logistic regression with the glmer function from the lme4 package to some data I have. Next, I've been using the influence.ME package to run some diagnostics (e.g. Cook's D and ...
0
votes
0answers
16 views

Appropriate cluster method for 7-point scale data of 58 variables and 635 observations

My research buddy and I are conducting cluster analysis on survey data using a 7-point relevance scale (1=Not relevant, 7=Extremely Relevant). We have 58 variables, arranged in 10 groups of ...
4
votes
1answer
72 views

Is the `weights=` option in lmer() doing what I want?

I want to predict PGA golfer performance. I'm wondering if I am correctly giving more weight to more recent results by using the weights= option in the lmer() ...
0
votes
0answers
12 views

How to calculate the effect size after Welch ANOVA?

I used oneway.test() because Levene's test indicated heterogenity of variance. Unfortunately, I don't know how to calculate the effect size now. Does anybody have ...
2
votes
3answers
77 views

How does the logit link handle binomial (1/0) data?

I have a data set that contains a continuous explanatory variable and a set of responses as binary success and failures. For example, ...
0
votes
2answers
49 views

Incorrectly rejecting a null hypothesis

What is the theoretical chance that we (incorrectly) reject the null hypothesis in the following case? ...
0
votes
0answers
9 views

Simultaneous and Pointwise Confidence Bands for GAMs

I am performing a penalized B-spline regression on a simple time series of count data in R using the mgcv package. When I calculate a pointwise confidence band from the standard error of the fit based ...
2
votes
0answers
71 views

Structuring Many-Factor Data for Linear Regression in R

I have a fairly large dataset of the following form, and I want to run a linear regression returning coefficients for each factor: ...
0
votes
1answer
42 views

Fisher Projection vs Linear Discriminant Analysis [closed]

Basically, I am confused between Fisher and LDA. Looking for differences between the two. How is the Fischer projection computed in R?
1
vote
0answers
15 views

Comparing adjacency matrices

I have 25 weighted adjacency matrices which can be potentially translate into 25 networks. I want to see how ``similar'' are the resulting networks (in a graph theory sense). Is there a way to do ...
0
votes
0answers
14 views

sapply with function using multiple columns as input [migrated]

I have a data frame with let's say 2 columns and 4 rows (it's bigger... I am just making it simpler) like this: Value: 0.2, 0.3, 0.5, 0.8 R: 1, 0, 1, 0 I m trying to write a sapply line that given ...
0
votes
0answers
9 views

error R in Crossvalidation (fold-3) and RR-BLUP and compare GBLUP [closed]

Crossvalidation three sets of genomic evaluation methods (fold-3) and two   RR-BLUP and compare GBLUP we run the following command in the program R; 1-Sincerely, with thanks, the other two that I need ...
0
votes
2answers
44 views

Word frequency in a vector [closed]

I have a vector file with 1000 values. All the values were generated using Random function between 0-1. ...
2
votes
1answer
13 views

Is RMSEA an absolute or relative fit statistics test?

I've been studying Structural Equation Model and I have a doubt about RMSEA. In the book Principles and Practices of Structural Equation Modeling Kline treats RMSEA as an approximate fit index (p. ...
2
votes
2answers
50 views

Grad level books for survivability analysis applied to manufacturing

I am looking for a grad level book on survivability analysis applied to manufacturing such as assembly lines. Preferably in R. I am familiar with measure theory, probability theory and R.
0
votes
0answers
9 views

R stepAIC multiple datasets

I have three datasets of similar(ish) sizes (268, 271 and 262), and a model I am trying to develop for describing a response variable within the data. I'm trying to use the ...
0
votes
0answers
24 views

Choosing k in consensus cluster plus using cophenetic correlation coefficient

I am trying choose best k from the consensus clustering using the Cophenetic Correlation Coefficient (CCC). I tried as follows. The correlation coefficients values are poor, i.e., ...
1
vote
0answers
16 views

Multinomial response with repeated measures

I'm studying how sex influences habitat use. I'm looking for suggestions on how to analyze a repeated measure design with a multinomial response variable. I should note that the number of repeated ...
0
votes
0answers
14 views

Calculating optimal alpha, beta, and gamma for Holt-Winters in R [closed]

Is there a way to calculate the alpha, beta, and gamma parameters in R for Holt-Winters? I tried using the one provided from the HoltWinters formula but it didn't give an accurate answer for ...
0
votes
0answers
23 views

How to identify a SEM with formative dependent variable (with R's lavaan package)?

I have a formative construct in a structural equation model (SEM) which I would like to estimate with the function sem in the ...
0
votes
0answers
23 views

“R” computing derivative of multivariate spline

I am trying to compute the derivative of a multivariate spline, in fact bi-variate I use a b-spline univariate to create a basis, for the first x1 and second variable x2, then I use the tensor product ...
0
votes
0answers
22 views

Computing hazard ratio between groups adjusting for other confounding variables

I have groups formed based on BMI; consider the standard Underweight, Normal, Overweight, etc. groupings for BMI as you might see for classification. I'd like to form a hazard ratio for comparing any ...
2
votes
1answer
46 views

logistic regression with an imbalanced data set, picking threshold cut point

This question relates to whether it is a good starting point for a cut point in binary classification with logistic regression to the use the mean of the binary response variable as the initial cut ...
0
votes
2answers
33 views

segmentation of univariate irregular time series

this is my first post. I have an irregular time series that exhibits large shifts in both mean and in the direction of the trend. It looks something like this (though this is far cleaner than ...
0
votes
1answer
14 views

Making a mob-like decision tree with pre-specified splits and models for leaves

I would like to make a special kind of hybrid tree model in R, similar to the mob models in the party and ...
0
votes
0answers
15 views

how to test if 5 data are homogeneous or not significantlly different

I am currently analysis data of radionuclide content in soil profiles. I have different profiles and data every five cm depth. Each profile contains 5 values of a certain radionuclide. I can represent ...
0
votes
0answers
26 views

Spatio temporal correlation of point data

I am working on a correlation analysis of two inter-relative phenomena, water leaks and water borne disease. Both are geo-references in lat/lon and each event is a date (of occurrence). I want to ...
1
vote
0answers
17 views

Reporting variable importance results using cforest

I have a large data set of odour samples. I used cforest and varimp to determine the most important variables (ie chemical compounds) in identifying sex. How do I report this in a paper? Do I need to ...
3
votes
1answer
65 views

How to interpret and do forecasting using tsoutliers package and auto.arima

I have got monthly data from 1993 to 2015 and would like to do forecasting on these data. I used tsoutliers package to detect the outliers, but I do not know how do I continue to forecast with my set ...
1
vote
1answer
17 views

plot only out of bag error rate in random forest

When I run random forest in R package and use plot function, there have many curves including out of bag error rate curve (black colour) and the misclassification error rate curves (other colours). ...
2
votes
1answer
41 views

How to set custom contrasts with lmer in R

I am using lmer in R to check the effect of condition (cond) on some result. Here are some made up data, where s is the subject identifier and ...
0
votes
0answers
18 views

Bootstrap pvalues: strange adjustment — pbkrtest PBmodcomp LRT

As far as I can tell, PBmodcomp is doing some straight up bootstrapping, similar to this Faraway example for lmer models mmod and rmod (maximal and reduced models): ...
1
vote
0answers
11 views

Spatio temporal correlation of point data

I am working on a correlation analysis of two inter-relative phenomena, water leaks and water borne disease. Both are geo-references in lat/lon and each event is a date (of occurrence). I want to ...
0
votes
0answers
22 views

How to estimate parameter k in hyperbolic discounting equation using maximum likelihood?

I've been learning and trying to estimate parameters using maximum likelihood, and I'm trying to understand the hyperbolic discounting equation. Here's the equation for hyperbolic discounting: $$y = ...
1
vote
0answers
29 views

Checking Cox model assumptions with multiple imputation

I have run multiple imputation using MICE. I would now like to run a Cox model on it (using with,pool), and make sure that is justified. That is, I need to make sure that the proportional hazards ...
0
votes
1answer
27 views

Extrapolate an Extended Cox model from 6 years to 30 without assuming a parametric distribution in R

I am attempting to extrapolate a Extended Cox Model (cox model with a time-varying covariate) from 6 years to 30 years in R. Is there a way to do this? I have thought of a mediocre way of doing this: ...
1
vote
0answers
24 views

AICc penalising model complexity too highly?

My analysis uses a negative binomial GLMM with total revisits as the dependent variable, treatment (factor with 4 levels: 0ppb, 4.8ppb, 20ppb, 133ppb) and size as fixed effects and colony as a random ...
0
votes
1answer
31 views

How to report confusion matrix of Random Forest classifier on test set using R? [closed]

First of all, I have to say that I'm newbie in working with R. Anyway, I'm going to apply Random Forest classifier on my data set using R. To do this, I beforehand divided my data set into training ...
0
votes
2answers
51 views

verified procedure for calculating gradient descent?

I'm wondering if there is a good procedure people are using for gradient descent that is pretty well validated--something like a package for R or Python, or generic code many people adapt. After ...
2
votes
2answers
135 views

analyse peak distribution in time series

Sorry if my question is too simple, I don't have much of a background in statistics. So I'll just try to describe the problem I need to solve in practice. I'd like at least to find out what known ...
0
votes
0answers
12 views

Multilevel between-matrix in R

R has tools for multilevel modelling (e.g., lme4), but I haven't been able to find an R implementation for multilevel correlation matrices on which the multilevel models are based. I'm looking for ...
0
votes
0answers
22 views

R - fitting a gamma distribution given the CDF?

I'm trying to develop a prediction model of the success or failure of a test run based on its current running time (in my data, from observation, the longer a test runs the more likely it is to fail). ...