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

Contradicting interaction significance with graphical visualisation in glmer

I'm investigating environmental effects (wind) on acoustic receiver detection probability for two types of transmitters using a binomial glmer. While my model analysis indicates that there's a ...
1
vote
1answer
26 views

Difference in frequencies in two groups of unequal size

I want to compare the frequency of retweets between 2 groups of unequal size. I've got the total tweet count and the retweet count for each user. I was hoping the R Cookbook webpage would help but the ...
0
votes
1answer
52 views

How to forecast time-series bounded by [0,1], i.e., forecast relative frequencies?

I am working with time series values which are all in the closed interval [0, 1]; these values represent relative frequencies, i.e., empirical probabilities. I would like to create a model such that ...
0
votes
0answers
13 views

After applying SVD, how do I find which features from my original dataset were most significant?

I'm using MathNet.Numerics library in C# to find the SVD but the Sigma matrix gives no indication of which values correspond to which features. It simply lists them in the most significant order. ...
3
votes
0answers
43 views

Survival Analysis why does probability drop to zero

I'm really new to stats and R and I suspect I'm missing something obvious. I have a set of memberships all who start after a point in time (six months ago). I have done my query to estimate the ...
1
vote
0answers
24 views

linear regression using heteroskedasticity robust standard errors in R

I want to perform an OLS regression on time series data using heteroskedasticity robust standard erros. So far i can come up with this: ...
0
votes
1answer
92 views

modelling data that contains only ones and zeros

I'm new to modelling this type of data, and I got punished for asking this on stackoverflow... I have a dataset where the predictive variables contain only ones and zeros, and the response variable ...
0
votes
0answers
28 views

Marketing Mix Modeling in R

I have 24 months of sales data by customer and when these customers were touched by different marketing channels (email, coupon, etc). I am trying to build a Marketing Mix Model to show me the ...
1
vote
2answers
50 views

Can we use a coefficient of variation as a statistic for testing homogeneity of variance?

There are well-known HOV tests, for example Levene's, Brown-Forsythe's, Barlett's available in SAS and R. But $C_v$ also deals with dispersion, can we use it to understand the degree of HOV? July ...
0
votes
0answers
12 views

Understanding Differential Expression Analysis in Microarray Experiments

Can someone please provide me a simple explanation of how differential gene expression analysis works? I know that this method is described in [1] and used in the R package limma. [1] Smyth, Gordon ...
1
vote
1answer
28 views

Combinef in R HTS package- constrain to keep forecasts positive?

When using the combinef function from Rob Hyndman's very useful hts package for forecasting hierarchical and grouped time series, there does not seem to be a way to constrain the optimally combined ...
0
votes
0answers
16 views

Specifying a glmm for panel data

I'm trying to predict counts based on variables sampled on a monthly basis as well as a few that are not related to time. In several places I've read that the MCMCglmm package in R would be ...
0
votes
1answer
31 views

Multivariate Time Series

I am trying to learn multivariate time series using R. I have two time series and I want to see if I could use one of those to predict the other one, and after that check if the model holds or there ...
0
votes
0answers
9 views

Select range of dates above and below another date [migrated]

Consider these small dataframes a and b: ...
0
votes
0answers
28 views

How to model non-linear time courses with nlme

I have some time course data which plotted looks like this: I am trying to fir a model to it using nlme.lme(). I am interfacing with R via RPy, and using the ...
1
vote
2answers
41 views

Is it important to convert “integer” variables (with 0 or 1 values) to factors?

I am working on a high-dimensional dataset (1776 variables). When I read the csv file, R loads variables (with 0 or 1 values) as class of "integer". Is it important to convert these variables to ...
1
vote
1answer
31 views

How to get the value of Mean squared error in a linear regression in R

Let a linear regression model obtained by the R function lm would like to know if it is possible to obtain by the Mean Squared Error command. I had the FOLLOWING output of an example ...
0
votes
0answers
8 views

Finding rows of a matrix meeting some conditions [migrated]

I want to find the rows that contain given column values. The first which() returns the expected 3 row numbers but last statement returns only 1 instead of 1 2 4 as I expected. This example ...
1
vote
0answers
37 views

How does the cubic spline basis exactly look like

By the definition I'll have (1) $S(x)=\begin{cases} S_0 = a_0x^3 + b_0x^2 + c_0x + d_0, & \text{if }t_0\le x\le t_1\\ .....\\ S_{k} = a_kx^3 + b_kx^2 + c_kx + d_k, & \text{if ...
0
votes
0answers
16 views

Robust Estimator for GARCH in R programming

I just want to know if R programming provides estimator estimation beside QMLE, because I want to compare these estimators' performance toward outliers. What package provides a function for this ...
0
votes
1answer
23 views

Partial least squares regression for categorical factor in R

I adjust the partial least squares regression for one categorical factor (2 levels – be or nottobe) with with the ...
2
votes
0answers
12 views

Where can I find the limiting distribution of the Kolmogorov-Smirnov distance in R? [migrated]

While doing an experiment on importance sampling, I simulate values of Kolmogorov-Smirnov distances $$ D_n = \max_x |\hat{F}_n(x)-F(x)| $$ where $n$ is the size of the original importance sample and ...
0
votes
0answers
15 views

How to analyse individual consistency from three non-normally distributed variables?

I would like to know if individuals were consistent across three different days. I measured the latency of individuals for a maximum of ten minutes. Many individuals had a latency of 0 and some ...
6
votes
4answers
172 views

Help creating a chart to show categorical data over time

The scenario: Over a course of 10 minutes 2 security guards patrol a floor and have their movement tracked. They can either be on the left or the right side of the floor, and within each side of the ...
-2
votes
0answers
50 views

Method to identify samples lying outside the normal distribution

In my previous questions I was looking for a method identify samples that had a variability significantly higher than the rest of my dataset. Methods to determine reliability of measurements using ...
1
vote
1answer
70 views

Forest plot for meta-analysis displaying the mean ES with and without outliers

I am conducting a meta-analysis and am trying to produce a forest plot displaying the mean weighted effect size with and without the outliers. I looked on so many websites and tried a lot of syntaxes, ...
0
votes
1answer
62 views

Data Acquisition in R [closed]

R is good at processing data. It is an analytic turbo-ginsu. So LabVIEW is great at getting data. It plugs into anything with electrodes. MatLab has simulink. There are toolboxes for data ...
0
votes
0answers
14 views

Conditional calculating the numbers of values in column with R [migrated]

have two vectors: x <- c(1,1,1,1,1, 2,2,2,3,3, 3,3,3,4,4, 5,5,5,5,5 ) y <- c(2,2,1,3,2, 1,4,2,2,NA, 3,3,3,4,NA, 1,4,4,2,NA) Here ...
0
votes
0answers
9 views

SSCP in analysis of covariance

I want to use analysis of covariance in R. The model is $y_{ij} = \mu + t_i + r_j + b(x_{ij} - \bar{x}) + e_{ij} $ In R it is possible to get Ryy, Tyy, Eyy, SSE as well as b and adjusted treatment ...
0
votes
1answer
35 views

using cluster information in multiple imputation

i need to impute a dataset all categorical variables before doing analysis. I can just simply impute with mode of all data or a variable. I belief that better option will be to classify the subjects ...
3
votes
1answer
29 views

Getting the equation from R's lm when using a product

Similar to this question: How to translate the results from lm() to an equation? in which the top voted answer said how to get the form of an equation from ...
3
votes
2answers
91 views

Grouping sequential values in R

I have a list of numbers I need to group by similarity (differences being 1 between each). For example, in a list of [198, 202, 207, 218, 219, 220], 190 would be put into a list, 202 would be put into ...
3
votes
1answer
27 views

How to plot correlation coefficients from multiple regressions while leaving out some of the variables from the plot?

Lets say that I have "y" that I want to model with linear regression. "x" and "z" are the things I'm interrested in showing folks, but I also have things that I want to adjust for, but not really show ...
0
votes
0answers
17 views

building a decision tree after association rules

I built association rules using R Arules package. Then I filtered those rules and kept rules that have a specific variable on RHS. That variable is my Y variable. In entire dataset, my variable occurs ...
0
votes
0answers
10 views

What are, in the r function glm, the families “quasi” and “inverse”? [migrated]

The glm function in R takes a "family" argument, which can also be set to "quasi" or "inverse". I couldn't find anything in the docs...
0
votes
1answer
38 views

What is the z-value of glm model parameters?

I know what the z-value of a single observation is, that is explained in Wikipedia. But what is the z-value of a parameter in a glm model?
1
vote
0answers
14 views

error structure in Generalized linear models when y is continuous data and errors not normally distributed

Lets say I have continuous y and x variable and I run a linear regression: mdl1<-lm(y ~ x) A generalised linear model should also give me the same parameters ...
0
votes
0answers
44 views

(Spatial) distance between cluster means

I'd like to cluster points based on a distance criteria. As I want to cluster spatial points I am using euclidean distance and a hierachical cluster approach. In a final step I'd like to cut the ...
0
votes
0answers
7 views

Obtaining Cohen's d from z-test statistic

After an ANOVA, I run post-hoc tests with the glht function in the multcomp package. glht ...
0
votes
1answer
35 views

Repeated-measures, crossover analysis using linear mixed model in R

I have a data set that I am attempting to analyse in R and I am relatively new to the environment. My full data set contains 7 subjects (represented by Subject), that all receive 3 treatments ...
0
votes
1answer
37 views

Calculating hypergeometric probability with approximations

I'm essentially trying to reproduce the dhyper function in R using !n ~ gamma(n+1). Why does this approach not work for large ...
1
vote
1answer
66 views

Analysis of Customer satisfaction surveys

I have customer feedback data about 2-3 products from 100 customers. Number of questions are around 160. I have data in excel format. Header row contains the question and row below contains the ...
1
vote
0answers
27 views

Odds ratios from logistic regression on subsets of data using R

I have 15 subjects each with 200 trials & I'd like to run separate regressions for each subject. If I just run the regression on the whole dataset I am able to generate odds ratios / confidence ...
1
vote
0answers
22 views

fitting an exponential decay onto a regression line

I have data for adherence to medicines which follows a downward linear trend for about 6 months (from 100%) and then plateaus at about 50%. Another way of describing it is by saying that adherence ...
1
vote
0answers
16 views

How to obtain estimates for all levels in a mixed effects model that uses effect (deviation) coding?

I am running a binomial mixed effects logistic regression in R using glmer for a sociolinguistics project. I was asked to used deviation (effect) coding. From what ...
0
votes
0answers
8 views

custom axis labels plotting a forecast in R [migrated]

I'm trying to get some sensible labels on a forecast. Here's my code: ...
0
votes
1answer
20 views

testing for mediation of interactions

I am somewhat familiar with various ways of testing mediation for factors in different types of regression analysis. (I'm using R and currently working with a multilevel binary logistic regression.) ...
2
votes
1answer
37 views

Jeffries Matusita distance for 14 variables

I wish to perform Jeffries-Matusita distance on 14 spectral bands. Is there anyone who can help with how it is done in R? Thank you.
0
votes
3answers
114 views

using random forest for missing data imputation in categorical variables ( in R)

I have following type of associated data. The following example step to generate associated variable. p number of variables and n is number of observations. ...