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

Is there a function that can execute a character string? [migrated]

I wonder if there is a function in R that like this. For example, the function is f. Similar with calculating the mean of vector ...
0
votes
0answers
41 views

How to do feature engineering?

Suppose I know nothing about the variables in this sample data set except that y is the response variable: ...
0
votes
0answers
24 views

Understanding random effects lme4 model

I'm trying to understand mixed effects models in R. I have 2 questions: What is the difference between the models m=lmer(y ~ 1 + x + (1+x|g), data=r.data) and ...
1
vote
1answer
56 views

Linear regression on data with multiple levels?

Here is a table with values that depend on two variables (VAR1=column names, VAR2=rownames). ...
1
vote
0answers
20 views

Aggregating estimates for weekly data

I have a data set (in R) measuring the performance of all machines in a factory at the end of one week. Each machine has various metrics captured (feature vector) and the ppm defects (predicted ...
1
vote
0answers
21 views

What Test to Use on Nominal Data

Sorry if this question has been asked, searched a bit and didn't seem to find anything related to what I was asking for. I have data on the visits by different groups of animals before and after ...
0
votes
0answers
15 views

which test to measure the trend in sales in R

I have sales data of an online store that is based in 4 countries. The Co. sends out Newsletters through out the year and found out at the end of the year that it sales from the newsletters has ...
0
votes
0answers
37 views

Categorical regression with dummy variables. significant or insignificant that is the question

I'm working on the similarity of categorical regression with exclusively dummy variables and ANOVA. There are lots of references, like Gujarati & Porter (2009), which have mentioned that those ...
0
votes
0answers
6 views

Understanding the Biclust class in R [migrated]

I'm new in R Language, but I'm using the biclust package for Bicluster Analysis. After to search information in web, I could run some biclustering algorithms but I could not access to the resulting ...
3
votes
1answer
60 views

Off-diagonal elements of a correlation matrix after removing the first principal component

I have some data with more variables than observations, that I'd like to subject to a principal components analysis. For didactic reasons (to give an intuition for factor retention criteria under ...
1
vote
0answers
43 views

How should I calculate performance with 3 kinds of response (yes, no and not applicable)?

I am having trouble calculating employee performance. I have an observation form with 34 behaviours, but not all of the behaviours are observed at one given time because it depends on the topic being ...
0
votes
0answers
10 views

Quantifying the most sensitive multivariate responses

I have traditionally been using the r2 obtained via different PERMANOVAs to ascertain which multivariate dataset was most sensitive to a factor consisting of two levels (e.g. impacted versus ...
0
votes
1answer
37 views

Analysing data from multiple matrices

I have created a function which produces 1000 different matrices simulating the ranking of football teams. The 1000th matrix produced is as so: ...
0
votes
0answers
15 views

Finding a single mode across rows of a data.frame in R [migrated]

I'm trying to find a singular mode value for each row in a data frame in R. I am using the mfv() function from the ...
0
votes
0answers
16 views

How to count these transitions - in R [migrated]

Given a table of values, where A = state of system, B = length of state, and C = cumulative length of states: ...
0
votes
2answers
55 views

Framework of multiple imputation

I read this paper about ("Multiple Imputation For Missing Data: What Is It And How Can I Use It?")(http://www.csos.jhu.edu/contact/staff/jwayman_pub/wayman_multimp_aera2003.pdf) Does any one have ...
0
votes
0answers
32 views

Data Fitting using R Code

I'm trying to use a copula function but I do not have the equation for my data, I just have all my raw data. Since my data is not normal, I tried fitting it into a normal distribution using the ...
0
votes
0answers
6 views

MICE R Polyreg implementation error? [migrated]

In MICE R mice.impute.polyreg.r (imputation for categorical response variables by the Bayesian polytomous regression model), it is mentioned that the method ...
0
votes
0answers
30 views

P-P and Q-Q plots for Mixture of von Mises Distribution

I am using the movMF package in R to fit a mixture of two von Mises distributions to my angular data. I am able to obtain the parameter estimates for the mixture ...
0
votes
0answers
39 views

Help with (nested?) ANOVA model in R

I would need some help how to write the model formula of an ANOVA in R. The experiment is a 4x4 Latin Square with subtreatments. Each plot has 4 rows and 4 columns, each row and each column contain ...
0
votes
1answer
25 views

Why does ctree(partykit) perform worse than rpart for a large dataset?

I am trying to solve the same classification problem with the R packages rpart and partykit. I would have expected better ...
0
votes
0answers
5 views

Cross Validation using Zelig package [migrated]

I am using Zelig package inside R and i want to run cross-validation. ...
3
votes
1answer
99 views

What is the distribution of sample correlation coefficients between two uncorrelated normal variables?

I want to compare observed bivariate (Pearson's $\rho$ and Spearman's $\rho$) correlations coefficients with what would be expected from random data. Assume that we measure, say, 36, cases across ...
0
votes
0answers
48 views

Leave-one-out cross validation output interpretation and ROC curve

I have taken plenty of time to try and help myself, but I keep reaching dead ends. I have a dataset consisting of body measurements collected from a bird species, and the sex of each bird (known by ...
0
votes
0answers
19 views

Doing PCA with varimax rotation in R [migrated]

My code has gone south. I'm importing a data 578x17 sheet from csv using the: ...
1
vote
0answers
50 views

Understanding / plotting 2 variables where both are allowed to vary in logistic regression

I'm hoping someone can help clarify a few things for me. I ran some relatively simple logistic regressions in r and am having trouble with interpretation. I'm interested in the effects of elevation ...
1
vote
1answer
40 views

Does Cohen's Kappa sample size calculation need a check for “true kappa” feasibility?

The sample size computation require(irr) N.cohen.kappa(rate1 = 0.9, rate2 = 0.5, k1 = 0.7, k0 = 0.5, alpha=0.05, power=0.8, twosided=FALSE) successfully runs and ...
0
votes
1answer
37 views

Comparing lsmeans of levels from different factors

I have a glmer model that I am performing contrasts on. My model has four factors (emotion, gender, filter, ageGroup). No interactions. I have been using ...
1
vote
2answers
37 views

Bayesian GARCH: forecasting volatility and returns

I am interested in forecasting conditional volatility, $h_t$, and returns, $y_t$, in a Bayesian GARCH framework. I am using the bayesGARCH package by Ardia in R ...
2
votes
1answer
89 views

VAR forecasting methodology

I am building a VAR model to forecast the price of an asset and would like to know whether my method is statistically sound, whether the tests I have included are relevant and if more are needed to ...
3
votes
1answer
60 views

How does the complexity parameter correspond to the number of splits in cross validation in rpart?

library(rpart) tree = rpart(Kyphosis ~ ., data=kyphosis, control=rpart.control(minsplit = 1, cp = 0, xval=10)) plotcp(tree, minline = FALSE, upper=c("splits")) ...
0
votes
0answers
18 views

Recommended Reading - Covariance & Correlation in R for Time Series [duplicate]

I'm at the beginnings of trying to find this out, and much of the reading out there is not quite what I'm looking for. I'm looking for recommended reading for determining correlation or covariance ...
1
vote
1answer
54 views

How to test if I can use cross-correlation?

I want to compare two time series in R and see if they are cross-correlated (with ccf). I believe that they have to be stationary? How that my data is stationary in R and are there any other ...
2
votes
1answer
116 views

Repeated measures - random effects for logistic regression in R?

Study design 504 individuals were all sampled 2 times. Once before and once after a celebration. The goal is to investigate if this event (Celebration) as well as working with animals (sheepdog) ...
0
votes
0answers
27 views

R - Plotting a ROC curve for a Naive Bayes classifier using ROCR. Not sure if I'm plotting it correctly

I have a Naive Bayes classifiers that I'm using to try to predict whether a game is going to win or lose based on historical data. The model has 25 variables in total, all of which are categorical ...
1
vote
0answers
19 views

Where can I found an implementation of a dynamic panel data model with garch in mean effects in R, Python or other language?

Where can I find an implementation of models such as the ones described in Cermeño and Grier (2001)? This is particularly interesting to estimate risk-return relationships using cross country data.
1
vote
0answers
24 views

Maximum Likelihood Estimation for Bivariate Burr III Copula parameters

The Copula of Bivariate Burr III Rodriguez distribution is: $$ C_{xy}(u,v) = ({{1+\alpha (u^{-1/{\epsilon}}-1) (v^{-1/{\epsilon}}-1)+(u^{-1/{\epsilon}}-1)+(v^{-1/{\epsilon}}-1)}})^{-\epsilon} $$ ...
0
votes
0answers
20 views

DBSCAN application for detection of anomalous instants in a particular time series

I have time series/matrix with cpu utilization of 4 servers (about 17k points). I am trying to use DBSCAN algorithm to find out which server is operating suspiciously compared to other using the ...
0
votes
0answers
14 views

Performing a 2-1-1 multilevel mediation in r

I'm interested in the relationships between the following three variables: religiosity, teleological explanations of daily events, and gratitude resulting from those events. I have collected data ...
3
votes
2answers
75 views

Sample from distribution given by histogram

Given a histogram obtained using given data points, how do I randomly sample from the distribution predicted by the histogram? Any conceptual comment / R code would be welcome.
0
votes
1answer
20 views

R nnet (Caret) not giving results for size = 8 and above

This is my first post in CrossValidated hence please let me know if I may have inadvertently violated forum rules. I am working with nnet using Caret in R and when I am running experiments using the ...
0
votes
0answers
15 views

Modeling attrition of customers - survival analysis?

I have a dataset of the following form: ...
0
votes
0answers
11 views

State Space Model Specification (KFAS)

I am using KFAS to fit a dynamic logistic model of the form; $\hat{y} = \bf \beta_t x + \epsilon$ $\beta_t = \beta_{t-1} + \eta$ So the regression parameters change over time, and act as latent ...
1
vote
0answers
17 views

R package for non parametric G*E interaction

Is there any R package to find out non parametric G*E interaction tests like Kubinger's Hildebrand's and De Kroon and Van der Laan test?
0
votes
0answers
56 views

R Mixed model for disease severity over time

I have 2 replicates of an experiment testing 4 chemical treatments for accelerating the visibility of a disease severity (y) in fruits (5 fruits/treatment). Identification of experimental units are ...
0
votes
0answers
23 views

How to utilize a test set that contains variables not found in the training set?

Suppose I have data as follows(example): ...
1
vote
1answer
14 views

Using re.form= in predict.merMod() for a lmer() model

If I fit a model with a random-intercept and random-slope then use predict.Mermod with re.form = ~ (1|Subject), my gut told me ...
1
vote
2answers
59 views

How does Random Number Generation work?

I'm using the set.seed() function in R to achieve reproducability of my results. I compare different regression methods (e.g. RandomForest, SVM, GAM) by their MSE derived from a cross-validation ...
0
votes
0answers
32 views

Q-Q plot standardized log returns vs log returns

When working with financial returns and detecting heavy tails with EVT, Q-Q plots can be used to make assumptions of the normality of the data(e.g.). Using standardized log returns in qq plots one ...
0
votes
2answers
32 views

How to calculate Standard error of Normal Distribution with given Confidence Intervale

I have one basic question in preforming the forecast of fertility rate. I assumed if the fertility rate (is normally distributed) is equal to 3.0, there is an 80 per cent chance that fertility would ...