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

Mixed effects structure: Main effects in random slopes with between-subjects design

My question is about whether it is appropriate to include certain random slopes in a mixed effects model with a between-subjects design. This is my first question on this stack exchange, and I'm ...
1
vote
1answer
12 views

How to assess the functional form of covariates in the Cox model with martingale residuals in R?

I want to find if the functional forms of covariates in my Cox model are linear. I understand the way to do this is to plot the Martingale residuals against the covariate of interest. I have found ...
0
votes
0answers
5 views
0
votes
0answers
22 views

I get unusual (wrong) results when plotting regressions with log10 axes compared to linear axes

When plotting a datasets of values and then using linear regression I get different (unexpected and seemingly wrong) results when plotting using log10 on both axes. Can someone please help. OK code ...
0
votes
0answers
12 views

Better calculation of ends of the curve when using R's RandomForest?

I've been using R's randomforest library to predict a series of (2000) products with prices ($10-$2000) and I'm noticing the low and high ends of the continuum are least accurate, especially when I ...
0
votes
0answers
12 views

Standardized coefficients for linear models with numeric and factor variables in multiple linear regression using scale() function in R

I have on question regarding standardized coefficients (beta) in linear models. I have already asked one question here. From the answers I assume that I should use R's ...
0
votes
0answers
26 views

lotto simulation with R

What is the simplest way to make a lotto simulator. Lets assume that I bought 10 different combinations ( 7 out of 39). So how to calculate the expected value of winning if for 4,5,6,7 correct ...
0
votes
0answers
4 views

klaR package and the stepclass function

(R studio) Hi, I'm running LDA on a dataset with 250,000 observations, 2 classes and 30 variables. My goal is to create a classification model using the LDA function. After loading my variables I ...
3
votes
0answers
40 views

How to best approach ANOVA with multiple response variables that might be correlated and Bonferroni Correction

I need some help verifying a simple analysis. I have completed a simple two factor experiment of more or less equal sample sizes. Let's assume for the case of this question that the sample sizes are ...
0
votes
2answers
30 views

Compare continuous variable between groups

...
0
votes
0answers
2 views

R: coherency matrix returned by spectrum is always 1

I am trying to understand what the coh value obtained from a call to spectrum means. I created a random 20x4 matrix and called spectrum on it. The ...
0
votes
0answers
18 views

Reading in data set [on hold]

I am trying to read in this data set using R http://statweb.stanford.edu/~tibs/ElemStatLearn/datasets/nci.data I've tried several different things. Can anyone help me out?
0
votes
1answer
23 views

How to solve nonlinear optimization problem in R

Suppose I have a set of data and reason to believe the following relation holds y ~ a0 + a1*x1 + a2*x2 + a3*log(x3) How can I use R to solve for the coefficients {a0, ... a3}, supposing I want to ...
0
votes
0answers
16 views

Regarding Nested Anova in R

I would just like to double check if my approach to the following analysis was correct. Based on my design I have two treatments (A and B) with treatment A being comprised of 5 populations and B of 3 ...
2
votes
0answers
18 views

“Frequency” value for seconds/minutes intervals data in R

I'm using R(3.1.1), and ARIMA models for forecasting. I would like to know what should be the "frequency" parameter, which is assigned in the ts() function, if im ...
0
votes
0answers
3 views

extract data.frame() from group_by() [migrated]

I'd like extract a data.frame produce by group_by() function of the dplyr package on R. My original data looks like this: ...
0
votes
0answers
17 views

Selecting the right BIC value

I'm using the hddc for an assignment to find the optimal number of clusters. The dataset is 9-dimensional and consists of 200.000 rows, however, the BIC values that I'm getting are really high. How ...
0
votes
0answers
19 views

mixed effect regression model

I would like to expand over a previous question of mine (What is the correct model for this experiment design?), with slight modifications... To set up the scene : We have a completely randomized ...
0
votes
0answers
17 views

Generate observations from an autoregressive process [on hold]

I'm wondering how I could go about generating data from an AR process, for example: $$y_t=0.2+0.5y_{t-1} +e_t$$ where $e_t\sim N(0,1)$ with $y_1=0.2$ I need to generate 100 observations from ...
0
votes
0answers
25 views

Multivariate regression with categorical response variables

Explanation of Data: I started with a data set where each user belong a specific group and their contribution to different domains. After multiple pivots and pre-processing attempts, I got my data in ...
0
votes
0answers
19 views

How to enter data into contingency table directly?

I'd like to create a contingency table. I do it using: matr=matrix(c(62,61,36,19,10,21,58,60,39,22,12,19,91,83,72,23,52,62,43,28,59,57,29,20,12),5,5) but it ...
0
votes
0answers
9 views

Heavy-tailed RBF kernel function

I'm trying to run a SVM regression on some data and I want to use ksvm from kernlab or svm ...
0
votes
0answers
18 views

Phylogenetic General Least Squares, Multivariate Regression

I'm working on a biological question, with species data derived from an external database, which has multiple response and predictor variables. As a result, I want to do multivariate regression across ...
0
votes
0answers
22 views

Determine the causes of change in time with mixed models

I have a database with several continuous variables measured in two times. I searched for a change in time in my dependent variables in this way: ...
0
votes
0answers
50 views

Small loadings in all variables, PCA analysis is ok?

I'm performing a PCA analysis on a set of 5 variables, whose correlation matrix is: ...
0
votes
0answers
18 views

How to interpret ANOVA output comparing two models

I'm working with the Blackmoor data from the study "Female adolescents with anorexia nervosa and their parents." I've made 4 models based on this: ...
0
votes
0answers
33 views

Using principal components to perform further PCA

I am working with principal component analysis for the first time. I have managed to extract the principal components of one set of data (say data1) using prcomp(). ...
0
votes
0answers
4 views

How to use filter in dplyr to find values in muliple columns without using '|' [migrated]

I want to use the 'dplyr' package in order to return rows in a data frame that contain some numeric or character values in any of the columns. For example, ...
0
votes
0answers
21 views

verify the central limit theorem of chi sq distribution

hi i have a question on verifying the central limit theorem using R. the question was to use data generated from different statistical distribution n see if the sample means follow normal ...
0
votes
0answers
6 views

Frequency form to case form - unexpected values in table [migrated]

I'm taking count data on voting preferences by race and entering it into a table in frequency form, then expanding out to case form and using CrossTable to look at ...
2
votes
1answer
59 views

Finding peaks in power spectrum of a signal in R

I am analyzing some eeg waveforms and developing a classifier based on them. In the data I have, I usually find a strong peak at a very low frequency (I am not interested in this peak) followed by ...
0
votes
2answers
53 views

weibull mle with optim in R

I am fitting a weibull distribution to some data. Let us say we have the data in warpbreaks, that is, warpbreaks$breaks in R. My code is as follows: ...
0
votes
1answer
23 views

Can C4.5 handle continuous attributes?

I'm trying to play with the breast cancer data available through UCI: https://archive.ics.uci.edu/ml/machine-learning-databases/breast-cancer-wisconsin/wdbc.data When trying to classify the data ...
2
votes
1answer
56 views

One observation per level in mixed-effect model

Field explains how to analyse repeated-measures data using linear mixed-effect models (LME). See Field et al., Discovering Statistics Using R, 2012, p. 573. However, the way he specifies the model, ...
0
votes
0answers
20 views

Boxplots with percentiles instead of hinges [duplicate]

I am new to R and am working with a dataset refined of 254 datapoints that are in 12 different groups and would like to compare the parameters with boxplots between ...
-3
votes
1answer
73 views

Bayesian Data Analysis [on hold]

I started recently studying the Bayesian Data Analysis. I installed R studio, BEST and JAGS. I ran this analysis on two groups of means (...
0
votes
0answers
13 views

Gibbs Sampling form Non-standard distribution in R

Gibbs sampling examples in R has involved initializing and updating iteratively from conditional that are in standard form. Has anyone performed on a gibbs sampling when the conditionals are in ...
1
vote
1answer
55 views

Box plot with just two values does not have its whiskers in R

Are boxplots by default unable to produce the whiskers when there are just 2 values being input? I am working with dataset rufi and the values input are ...
0
votes
0answers
17 views

GAM and ordered probit regression in R

I want to check the fit of the ordinal probit regression model with the help of GAM (generalized additive models). There are plenty of examples how to construct GAM for dichotomous responses in R. ...
0
votes
1answer
24 views

Pointers on calculating probability/odds from data vectors

I am trying to figure out how to calculate probability and odds for the variable Target. ...
0
votes
1answer
11 views

Which post-hoc is more valid for multiple comparison of an unbalanced lmer-model: lsm or mcp?

After doing a model comparison with my mixed lmer model, I have a model with three main effects, no interaction, say ...
0
votes
0answers
13 views

type of ICC coefficient to use in my study for inter und intrarater-reliability

I am new to the subject and not sure, which ICC I have to use in order to analyse inter/intrarater-reliability of my measurements. A physician examined 649 healthy individuals with an ...
1
vote
0answers
42 views

Basic question about getting esimated probabilities in R

I've got what I think is a fairly basic problem. I'm not sure if it is a conceptual question or software question, but I'm fairly new to using R and these kinds of stats, so it could be either or ...
0
votes
0answers
4 views

geeglm Model matrix is rank deficient after scaling the predictors?

Trying to run a linear regression with repeated measure using geeglm. Here is my original model: ...
0
votes
0answers
17 views

How do I report the result of an mcp-Tukey-test, i.e. how do I report it's z value?

After doing a model comparison with my mixed lmer model, I have a model with two main effects, no interaction, say signal ~ factor A + factor B + (1|subj). Factor ...
0
votes
0answers
27 views

Visualize a large binary matrix with instances and three classes

I have a matrix with 9500 columns and 1000 rows. Each row represents an instance. I have three classes and an instance belongs to a class. Each column represents a binary feature. That is, each cell ...
0
votes
0answers
27 views

Calcuate Bayes Factor for Adjusted Mean Difference

I have an ANCOVA model shown below (fit) where I calculated the mean difference between two groups while controlling for another variable (x). For the adjusted mean difference (288.72), I'd like to ...
0
votes
1answer
33 views

Correlation Between 2 uneven samples size

I am trying to determine the correlation between an observed and theoretical set of data. Both sets of information are in the form of a table of deflection against time. Both samples have the same ...
0
votes
1answer
50 views

Linear regresson lm or stepwise regression here using R?

It is a basic question but I could not find clear answer on my reading. I am trying to find independent predictors of Infant.Mortality in data frame 'swiss' in R. ...
0
votes
0answers
22 views

R - basic multiple imputation with the mi package

Consider the following R code: ...