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

Cannot get the p values from afex package

According to this website: http://www.psychologie.uni-freiburg.de/Members/singmann/R/afex I have run: ...
0
votes
1answer
15 views

What is the difference between the Mann-Whitney and Wilcoxon rank-sumtest?

First of all, what is the difference between the Mann-Whitney and Wilcoxon rank-sum test? How do I choose between the two? I know the latter is implemented in R, is there a way to do the Mann-Whitney ...
0
votes
0answers
5 views

In R and INLA, how do I graph results of 'rw2' model?

I'm working with model 2 of INLA's Zambia example in R: ...
1
vote
1answer
56 views

Smoothing spline with dependent coordinates in R

I have a series of patients in whom I have measured the value of a certain blood quantity at several time points. However, the time points vary a lot and the number of measurements range between 2 and ...
1
vote
1answer
91 views

R: generate binomial sample with (pretty) exact probability

When I simulate normal data in R, I make sure that the sample have the exact mean and sd of the sampling distribution: x = scale(rnorm(n))*sd + mean. I want to do ...
-1
votes
1answer
11 views

Error: object 'descr' not found

I am trying to follow up the example code in the "Building Predictive Models in R Using the caret Package" paper from Max Kuhn[1]. Here is the part of the code: ...
4
votes
2answers
44 views

Name for combining related graphics

Often we combine related graphics to help us better understand a problem. We do this for poster talks in research (though we include text). Many info-graphics also do this as do this as do ...
0
votes
0answers
9 views

R programming: Lapply(split) and Model Generation [on hold]

I would like to generate and store for multiple models to subsets of my data, but am having a hard time getting the programming code to produce correct output for more than one model. I have hundreds ...
1
vote
1answer
21 views

AICc and K for categorical factors and interactions

I am new to multimodel inference. I am trying to create a model that has multiple categorical factors and possible interactions. For example say that my model is... Y ~ X1 + factor(X2) + ...
0
votes
0answers
22 views
+50

JAGS prior-based prediction

I'm trying to use rjags to predict what the curve-maximums will be for different groups of incomplete data (one metric x and one metric y). Here is an example of the indata: ...
0
votes
1answer
11 views

Using Mantel to explore relationship between geographic distance and a multivariate character

I'm working with bird songs. A song is composed of many vocal parameters [highest frequency (Hz), lower frequency(Hz), bandwidth(Hz), duration (s), number of notes, and son on....] I'm interested in ...
5
votes
2answers
4k views

Whether to use an offset in a Poisson regression when predicting total career goals scored by hockey players

I've got a question concerning wheter or not to use an offset. Assume a very easy model, where you want to describe the (overall)number of goals in hockey. So you have goals, number of games played ...
0
votes
0answers
27 views

Two sampled t test in R? where did it go wrong?

I am doing two sampled t test on two species of fish. t.test(fish1,fish2) It runs for a year so there are 365 values for each fish, i.e. $(1,0,1,0,0,2...)$ and ...
3
votes
1answer
96 views

detect line in scatter

I have repeated samples from the following process: Most samples will only contain points that are randomly distributed on a 2-dimensional plane. Sometimes, however, the sample will contain not only ...
1
vote
0answers
26 views

Find linear subsets in a 2D point (xy) data [duplicate]

My problem is the very idea of how to start the analysis of 2D point patterns, specifically how to find linear trends within their spatial pattern. I have XY data points which are organized like in ...
0
votes
1answer
54 views

Organize data with multiple levels of a categorical variable per entry, for easy R analysis

I need some help here. I have some data in which every entry can take one or more levels of a categorical variable. for example, I have a category with 3 levels: ...
2
votes
0answers
35 views

Bootstrapping some statistics with non-normal data

I am new to bootstrapping. Assume I have some non-normal data, can be any distribution, it doesn't matter, and I want to find a confidence interval for the mean, median and standard deviation. For the ...
0
votes
0answers
9 views

Limiting the range of possible values for distribution fitting with GAMLSS in R

I'm trying to fit ST5 distribution for reaction times with GAMLSS. Sometimes mu parameter of the distribution is negative, which is implausible. Is it possible to limit the range of parameter values ...
2
votes
1answer
66 views

Exploratory Analysis - finding the most important factor

I have a dataset of 113 variables. In exploratory analysis the first thing I want to know is what are the most important factors on a single variable (revenue). I learned that naive Bayes would ...
0
votes
0answers
31 views

why Hierarchical Clustering pvclust vs. hclust got different result?

I am performing the hierarchical clustering analysis on a dataset of 25 viral populations using 3 viral components (variables) to construct a dendrogram with average method and correlation distance ...
5
votes
1answer
712 views

Document classification with Bayes

I want to build a document classifier in R, using the Naive Bayes approach. Here are steps, that I've done so far: I have corpus with about 30 documents from 2 authors (Classes are: "target author" ...
1
vote
0answers
15 views

studentized residuals in nonlinear regression

I am using the nls function in R to perform a nonlinear regression and need to calculate the studentized residuals. Is this something I need to manually do? It seems like I need to manually do a QR ...
1
vote
0answers
16 views

Weighted Least Squares with Standardized Coefficients

I want to understand how weighted least squares regressions work to implement it in a more complex context. I think I'm a good step into that process, but I'm still wondering what the correct way to ...
22
votes
2answers
354 views

How scared should we be about convergence warnings in lme4

If we a re fitting a glmer we may get a warning that tells us the model is finding a hard time to converge...e.g. ...
0
votes
0answers
15 views

Finding extreme values in a normal distribution [migrated]

I want to find extreme values (anything greater or less than three times standard deviation from the mean) after generating a set of random numbers using: ...
0
votes
1answer
70 views

data analysis about data clustering by vector correlation distance

I am working on data analysis. Given a group of data vectors, each of them has the same dimension. Each element in a vector is a floating point number. ...
0
votes
1answer
460 views

predict function and categorical variables in R

This is more of a general question about how the predict function treats categorical variables and how to interpret the output from predict. I have a zeroinfl model to predict the number of animals ...
0
votes
0answers
13 views

dose anybody know usg fastSOM packages in R?

I recently know the fastSOM package from google. So I download the package. But I’m beginner in R. And I really want to studying spillover measures because I’m interested in volatility spillover. ...
0
votes
1answer
30 views

Is there an R equivalent for the SPSS custom Tables feature?

I have used the custom tables feature in SPSS for my job almost every day. I am trying to learn R . How can I recreate the custom tables functionality in R. Is there some specific package that I need ...
4
votes
2answers
786 views

How to combine multiple imputed datasets?

I need a single imputed dataset (e.g. to create a country group dummy from the imputed country per capita income data). R offers packages package for creating multiple imputed data (e.g. Amelia) and ...
1
vote
0answers
24 views

Interpretation of Zero-One inflated Beta Regression with R (GAMLSS)

I am not that familiar with the interpretation of a beta regression with the r-package GAMLSS. Papers and package manuals didn`t help me. I modeled a Zero-One inflated Beta Regression. The ...
0
votes
1answer
7 views

import kernlad model to caret

I'd like to test the anova rbf kernel included in the kernlab package in caret. Following excelent tutorial (https://topepo.github.io/caret/custom_models.html) I've come up with the following code: ...
0
votes
0answers
5 views
0
votes
1answer
24 views

Measures of goodness-of-fit using multiply imputed data in Zelig

I am running a logistic regression model in R using multiply imputed data created using Amelia II, which I am then analyzing using Zelig. I would like to be able to report some measures of ...
2
votes
1answer
28 views

How to test if some data points is drawn from a distribution with linear PDF?

I have some data in the range [0, 1], and from the histogram below, it seems that they might be drawn from a distribution with linear probability density function (what's the name of that kinds of ...
1
vote
1answer
42 views

Specifying a linear mixed model in lmer with replications nested within a fully crossed design

I’m trying to specify a linear mixed model for a somewhat complicated, nested & crossed method comparison study with replicated measurements. The goal is to partition and compare variances. It’s ...
0
votes
0answers
30 views

R highfrequency package [migrated]

I'm newbie to R, I'm using it for my thesis on trade classification algorithms. I've some problems with the package highfrequency. I've converted my txt data in ...
0
votes
0answers
13 views

trouble using highfrequency package in R [duplicate]

I'm newbie to R, I'm using it for my thesis on trade classification algorithms. I've some problems with the package highfrequency. I've converted my txt data in xts format using the code: ...
7
votes
1answer
2k views

Split-split-plot design and lme

I’m working on a data set in order to evaluate the impact of drying on sediment microbial activities. The objective is to determine if the impact of drying varies among sediment types and/or depth ...
2
votes
1answer
2k views

rpart and the printcp function

I don't really understand how the columns "xerror" and "rel error" are calculated. I found out that the printcp() function "gives cross-validation estimates of misclassication error (xerror), ...
1
vote
5answers
4k views

Subset data by month in R

I am working with a time series of meteorological data and want to extract just the summer months. The data frame looks like this: ...
0
votes
0answers
13 views

Interpreting R results, are the data multivariate normal?

I ran "mvn" using the "mclust" package in R using the following codes: mvn("EEE", data[,18:22], prior = NULL, warn= NULL) I am having trouble figuring out how to ...
1
vote
2answers
21 views

Factor or No-factor

I am performing linear regression in R and I have a variable called diversityscore which is a value ranging from 1 to 10 indicating #activities a user performs with 1 meaning one activity to 10 ...
2
votes
2answers
51 views

Test identicality of discrete distribution

Is there a standard way to test whether two vectors were drawn with the same discrete distribution in R? Something like a Kolmogorov-Smirnov test, but for discrete distributions. I think two-sample ...
2
votes
1answer
147 views

Nested vs random effect

I'm having a little trouble analysing a data set from the following experiment: we applied 4 treatments (control, ...
0
votes
1answer
100 views

Negative value prediction using gradient bosting with Gaussian distribution in gbm

Why does gbm specified with Gaussian distribution throw negative values? Can it be controlled or modified if one does not want negative predictions (in ...
0
votes
0answers
11 views

Fitting GLMMs for binomial data produces Error and Warning messages when using different fitting procedures in R.

I am trying to fit GLMM's to my data using the glmer function available in R's lme4 package. The data is available under the name block1and2 at: ...
2
votes
1answer
90 views

Generating Random Variables with given correlations between pairs of them:

I want to generate 2 continuous random variables Q1, Q2 (quantitative traits) and 2 binary random variables Z1, Z2 (binary traits) with given pairwise correlations between all possible pairs of them. ...
2
votes
1answer
1k views

Examples for One class SVM in R

I am trying to do one-class SVM in R. I have been trying to use e1071/ksvm kernlab package. But I am not sure if I am doing it correctly. Is there any working example for one-class SVM in R? Also, ...
2
votes
3answers
120 views

Sliding threshold for hypergeometric test

I have a list of 20,000 genes with an associated p-value (the total number of balls in the urn). I also have a list of specific genes that are "targets" of interest (these are the white balls in the ...