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

1
vote
1answer
187 views

Categorical variable coding to compare all levels to all levels

I am trying to determine the best coding system for my categorical variables to use in a regression with categorical and continuous variables. I have been using this page as a resource but none of the ...
0
votes
0answers
4 views

What are the best packages for HMM sequence analysis?

I have a sequence of events and I want to learn discrete probabilities of transitions between them and to predict next item in a sequence. Can you point me on good papers and Python or R package for ...
6
votes
1answer
326 views

Estimating adjusted risk ratios in binary data using Poisson regression

I am interested in estimating an adjusted risk ratio, analogous to how one estimates an adjusted odds ratio using logistic regression. Some literature (e.g., this) indicates that using Poisson ...
0
votes
0answers
7 views

Changing SVM tune performance measurement method (e1071 tune function)

Hi I am using e1071 package for SVM. I am using the tune() function to find the best parameters. It seems to me the default prediction function used is RMSE. However, I am having a binary ...
0
votes
0answers
9 views

searching for appropriate outlier method

I have data with the following summary: min: 7.59e-08 max: 67.1887 median: 0.03451017 mean: 0.1763083 estimated sd: 1.191953 estimated skewness: 39.27065 ...
0
votes
0answers
3 views

Parameter interpretation for discrete weibull regression

Please can someone provide an accessible interpretation of the parameter estimates from a discrete weibull regression model, e.g in R: ...
0
votes
1answer
59 views

Need a method for determining variable groupings in R

I am using R and trying to group one of my variables into larger groups so they have credibility. I have been manually setting each factor of the variable as the reference level, looking at all other ...
4
votes
2answers
35 views

How to create an arbitrary covariance matrix

For example, in R, the MASS::mvrnorm() function is useful for generating data to demonstrate various things in statistics. It ...
2
votes
1answer
119 views

Interpretation of various output of “lmer” function in R

library(lme4) fm1 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy) The notation (Days | Subject) says to allow the ...
2
votes
1answer
28 views

Key scientific publications reporting non-normal GLMMs in marine biology

I developed Poisson and Binomial GLMMs following the steps described in the excellent book from Zuur et al. (2009) Mixed Effects Models and Extensions in Ecology with R and I'm now ready to include my ...
1
vote
0answers
4 views

R/MASS kde2d and bandwidth.nrd

First off, I didn't know whether to post this here or on SO. I tossed a coin and ended here. Second, I'm trying to get a grip on the kde2d function in the MASS ...
0
votes
1answer
31 views

Multinomial mixed models with glmmADMB

I want to run a multinomial mixed effects model with the glmmADMB package of R. I have read the available information of the programm but i couldn't find which family or link has to be used for ...
0
votes
1answer
181 views

Glmer random effects model vs. dummy-coded fixed effects

I'm trying to analyze the data from an experiment I conducted, and could use some guidance in relation to fixed vs. random effects. The experiment was related to risk-seeking behavior in the context ...
3
votes
1answer
143 views

How To Deal With Large Numbers Of Categorical Predictors

I have three data sets that, when joined, have O(320) independent variables for a classification problem. Principal component analysis (PCA) seems out of the question because the data is mostly ...
1
vote
0answers
15 views

Tradeoff between Survival probability and detection probability: Mark-recapture

When scientists are using mark-recapture models on an open population model to estimate the survival probability and the recapture probability (also known as "detection"), how can we be sure that the ...
0
votes
0answers
13 views

Hypothesis testing on aggregated data

I have two suites in a hypothesis test, X and Y. They have integer values like What I want to do is give a good hypothesis test, which should show that X leads to more bookings (B). I have ...
3
votes
2answers
184 views

Calculating constant hazards in exponential survival distributions in R using survreg()

In an ecological seed removal experiment, we have seed removal data from 720 seed plates with 25 seeds each. For each plate, we know the number of "surviving" seeds at several times ti until the end ...
0
votes
0answers
8 views

chisquare outlier test assumptions

what are the assumptions of the chisquare outlier test? ( in R: chisq.out.test()) Is it only applicable if the data follow a certain Distribution? What is the idea of ist Definition of outliers? ...
4
votes
1answer
177 views

What are dangers of calculating Pearson correlations (instead of tetrachoric ones) for binary variables in factor analysis?

I do research on educational games, and some of my current projects involve using data from BoardGameGeek (BGG) and VideoGameGeek (VGG) to examine relationships between design elements of games (i.e., ...
2
votes
1answer
363 views

Adding a variance structure when fitting a gamm with Gamma distribution

I am using the code below to fit a gamma GAMM introducing a variance structure that informs the model that variance of the response variable is much larger in one of the levels of the factor coast ...
1
vote
0answers
27 views

optimize a function in r (error code) [migrated]

I have the following equation: Rp,t+1= the return of the portfolio .. fr = free risk rate.. ...
0
votes
0answers
4 views

Error using mlogit pkg in R for logistic regression on Clinical dataset

I am a clinicians (limited statistical knowledge) who is trying to use mlogit pkg in R to analyze a clinical dataset, running logistic regression on it. I am trying to ascertain if there is any ...
0
votes
0answers
5 views

Analysis of a Factorial Design in R

I conducted a factorial design repeated measurement experiment about the influence of (IV_history) dynamic pricing and (IV_amount) comparison of your fee to the trading partners fee on (f) fairness ...
15
votes
3answers
317 views

Negative-binomial GLM vs. log-transforming for count data: increased Type I error rate

Some of you might have read this nice paper: O’Hara RB, Kotze DJ (2010) Do not log-transform count data. Methods in Ecology and Evolution 1:118–122. klick. In my field of research (ecotoxicology) ...
0
votes
0answers
49 views

Impossible to bring to normality

I have given a data and I have to check the data if it's normally distributed and if not I have to transform the data into normality. I had done shapiro-wilk normality test and p-value is clearly ...
0
votes
1answer
24 views

Bootstrapping data to generate the large no of samples for all the variable? [on hold]

I want to increase my sample to thousand? Suppose tree data.frame has 100 data point. Now i want to increase to 100. ...
0
votes
0answers
25 views

Generating sample numbers at a spesific distribution from uniform distribution [duplicate]

It's a known fact that we can generate sample numbers at random (Uniform distribution) from any probability distribution, given its cumulative distribution function. But if we want to generate sample ...
3
votes
3answers
587 views

Linear regression or mixed effects models for data with two time points?

I have a dataset in which individuals were assessed at two time points during the study on a cognitive test, as such I was wondering which statistical model would be more appropriate for my data, ...
0
votes
1answer
61 views
+50

How to indicate whether the improvement of a ranking is statistically significant over another one in R?

I have two ranked lists of documents (List1, List2). After comparing each of them against the ground truth, I calculate precision at 5 (P@5) metric to measure how good are each of the ranked lists. ...
0
votes
1answer
155 views

GAM summary F values

Does anyone know how the F values are computed in summary(gam.object). I've looked through the help page, and the gam package, ...
0
votes
1answer
49 views

What is the difference in how $\mathrm{R}^2$ and $\mathrm{R}$ values are interpreted?

In statistics, there is the $\mathrm{R}$ value for the product moment correlation coefficient and the $\mathrm{R}^2$ value for the coefficient of determination. In both cases they are described as a ...
0
votes
0answers
7 views

Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x' [on hold]

-2 down vote favorite I am trying to run an ordinal logistic regression (polr) using the package 'MASS'. I have successfully run other regression class (glm) without any problem (assuming the output ...
1
vote
1answer
426 views

HMMFit underlying algorithms

After reading article "Hidden Markov Models for Controlling False Discovery Rate in Genome-Wide Association Analysis" by Zhi Wei I am trying to use it in my project. I am using R and I have found out ...
0
votes
1answer
100 views

R C5.0 tree model to list conversion

I am using the C5.0 decision tree in R from the C50 package. The training function C5.0 returns a list which also contains a "tree" element which is basically a text representation of the tree. I am ...
0
votes
2answers
299 views

Cluster Analysis for large data in R

I am trying to perform a clustering analysis for a csv file with 50k+ rows, 10 columns. I tried k-mean, hierarchical and model based clustering methods. Only k-mean works because of the large data ...
0
votes
1answer
22 views

Any way of getting vector of probabilities for each response with Naive Bayes in R?

I'm currently using naiveBayes from {e1071}. My response is simply a prediction based on my independent variables. Is there a ...
1
vote
1answer
469 views

Nested random effects and interaction terms in lme4

I have a data set containing various vegetation and geomorphic variables sampled in 3 distances on both sides of 43 drainage ...
1
vote
1answer
220 views

PSO Clustering using R using Repplab package

I wish to try clustering a matrix of numerical data using swarm intelligence. (Matrix is 28000 X 53 and sparse). I'm working in R and found the REPPlab package and used the EPPlab function. My ...
0
votes
1answer
9 views

Can we run an ordinal and multinomial logistic regression for combined independent variables' levels?

I have one outcome/dependent variable that can be ordinal or nominal and 3 independent variables. I have learned so far how to perform ordinal and multinomial logistic regression in SPSS between a ...
0
votes
0answers
12 views

Create weekly forecast of sales data and see impact of weather data on product movement

I am new to R and analytics. I am trying to create weekly forecasting model. Additionally , I have been asked to see if following components impacts product movement : Weather data ( Mean ...
-1
votes
0answers
10 views

extern indeces with R [on hold]

with python there is predefined functions of extern indices( like jaccard, hamming, accuracy)in the package sklearn.metric, to evaluate and compare between ground truth and the clustering result. is ...
7
votes
0answers
125 views

Implementation of CoVaR (a systemic risk measure) in R

I'm trying to estimate CoVaR using bivariate DCC GARCH in R. The concept of CoVaR is the dependence adjusted of VaR, which was first introduced by Adrian and Brunnermeier (2011). However, this ...
0
votes
1answer
18 views

Left truncated survival data?

I am attempting Attrition Analysis in R using the Survival & KMsurv Package. My question is more related to how to use the R package / functionality for my situation. Let us say the analysis is ...
4
votes
1answer
964 views

Checking the proportional odds assumption holds in an ordinal logistic regression using polr function

I have used the ‘polr’ function in the MASS package to run an ordinal logistic regression for an ordinal categorical response variable with 15 continuous explanatory variables. I have used the code ...
0
votes
0answers
5 views

Cubic function calculation in R [migrated]

I need the function (sin(x)/x)^3 to be evaluated in R a huge number of times. What is the fastest way: (sin(x)/x)^3, (sin(x)/x)^3L, or { y=sin(x)/x; y*y*y } ?
0
votes
0answers
23 views

Calculating binomial distribution in R [migrated]

I want to do some calculations on a binomial distribution Bin(100,0.55). In particular: P[μₓ - σₓ ≤ X ≤ μₓ + σₓ] I also want to calculate it using the normal approximation for the binomial: ...
4
votes
2answers
87 views

How can I compute a log odds ratio for a within-subject design that could be meta-analyzed with log odds ratios from between-subject designs?

Background and Problem I have a question concerning a meta-analysis combining effects from between- and within-subject designs using log-odds ratios (OR) as the metric of interest. I am familiar with ...
0
votes
0answers
9 views

Survival Analysis in R - left truncation

I am attempting Attrition Analysis in R using the Survival & KMsurv Package. My question is more related to how to use the R package / functionality for my situation. Let us say the analysis is ...
1
vote
2answers
214 views

Coursera Linear Regression with gradient descent with R

I am enrolled in a machine learning course for machine learning where we have a lab to implement linear regression I am attempting to do it in R to get a better understanding of the material and of R ...