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

How to deal with a single Yearly spike with ARIMA?

I have a time series data which shows an yearly spike around summerbut otherwise is predictable by an AR(1) model. The tests on the data also show that the time series shows stationarity and is ...
0
votes
0answers
6 views

How can I use “tsboot” in the boot package in R to do block bootstrap

How can I use "tsboot" in the boot package in R to do block bootstrap. Or alternatively, by what means can I perform Block bootstrap. please teach me step by step.
0
votes
1answer
6 views

Using roc() in R with a parametric response variable name in the formula

I have a column named inp, and 10 columns named resp1, ..., resp10 in a matrix in R, and I want to compute receiver operating ...
0
votes
0answers
5 views

R Shiny - Recursive indexing failed at level 2 [migrated]

Trying to create a shiny app where the there is a plot and the selected points create a table with said points. Having some difficulty locating the source of my error, but have been able to narrow it ...
0
votes
0answers
14 views

Histogram in R. Problem with Function hist() [migrated]

I have csv file with ID and variable. It looks like this ID V1 1 0 2 -0,12 3 0,05 .... if I use hist(mydata$V1) I get an error ...
1
vote
0answers
26 views

Is there any algorithm that can predict multi-variables(response variables) based on one independent variable

let me ask the question in detail with an example -- I have a historical dataset with columns(a,b,c,d,e,f,g) Now i have to predict (b,c,d,e,f,g) based on the value of 'a' and all the variables are ...
0
votes
0answers
20 views

spurious regression/co-integration

I have two I(1) time series and I regressed one against the other and found that it had low to moderate R-squared but my DW statistic is about 0.015. I know the literature says this is the case of ...
3
votes
1answer
27 views

KS test for Uniformity

I am attempting to use the KS-test to test whether a set of points is uniformly distributed over an interval, and I had a question about whether there may be a more optimal test for what I'm trying to ...
0
votes
0answers
8 views

Interpreting mean of coefficients by accessing $Beta in BMR package in R

I've been using BMR (Bayesian Macroeconometrics in R) package to carryout BVAR(Bayesian Vector Auto Regression). When defining the Minnesota prior for my monthly dataset and have obtained mean of each ...
0
votes
1answer
17 views

Obtaining regression model B-values in an OLS model in R

This is probably a fairly silly question, but I have the following regression model: ...
2
votes
0answers
16 views

Uniform Sampling from Intersections of Faces of Simplices

I'm trying to sample uniformly on the intersections of faces of several simplicies, with all coordinates being non-negative. That is, given constraints $$A\vec{w}=\vec{b} \ \ and \ \ \vec{w} \geq ...
0
votes
0answers
9 views

Data imported from stata, variables not found [on hold]

I am trying to import .dta STATA dataset into R. I input: library (foreign) read.dta ("E:/Gabrielle.dta") Then what seems to be some of my data appears with a mix of numbers and "NA" Then I input: ...
0
votes
0answers
9 views

R - Using function which to find out desired sample [on hold]

I have a dataset which 26 rows which 4 columns two as a labels "Features" and "Method" and the other two as values "% False Alarms" and "% Detections". I would like to find the best feature and method ...
0
votes
0answers
10 views

List of nlme models

I am trying to find a list of models that nlme provides. I am completely new to this area and finding it hard to get a comprehensive list of models that nlme provides facilities for. I have tried to ...
1
vote
0answers
27 views

Checking the assumptions of K-means clustering

I want to do a k-means clustering on a dataset containing 22 numerical variables between 0 and 100 and 75 observations using R. I read this post How to understand the drawbacks of K-means on k-means ...
0
votes
0answers
10 views

Anova Question - how to see an interaction between two variables over three blocks. Subset?

I'm getting myself confused about how to analyse interactions in r. I am looking at eye-tracking data. I have the time duration of the saccade (movement of the eye) as 'sacduration', the physical ...
0
votes
0answers
4 views

Anderson-Darling p-value different between Nortest and Adgoftest

I'm assessing the normality assumption in a data set using both ad.test function of nortest package and the equivalent in the Adgoftest one. The resulting p-values are strongly different and lead to ...
1
vote
1answer
30 views

best tool for plotting 3 3D lines in one plot

I'm trying to recreate an image using either R, Matlab or Python (the languages I know) but I'm having troubles finding a good library for the task. The image I'd like to recreate is the one below. ...
0
votes
0answers
23 views

Q: How to correctly include a categorial control variable in a regression model (in R)?

I'm trying to fit a (logistic) regression model to predict the successful funding of crowdfunding ventures (0/1) based on a series of IV with different level of measurement. One of these IVs is a ...
0
votes
1answer
22 views

Survival regression variance estimates

I would like help understanding why a survival regression with no censored data-points does not give the same variance estimates as a linear model (see code below). I think it must be something to do ...
0
votes
0answers
16 views

How to use the output of a RStan model to predict test set data? [duplicate]

I'm uber-new to Bayesian statistics and am tasked with implementing a housing price estimator using RStan (the Stan package for R). I'm quite consfused as to how to design the modeling activity in ...
1
vote
0answers
19 views

J48 in Weka and R [on hold]

I tried J48 classifier in Weka to train the learner and got an accuracy of 99% but when I supply it with test dataset it threw me an error saying Training and Test sets are incompatible. I failed at ...
0
votes
0answers
14 views

specification of mixed effects model with two levels of repeated measures (in R)

My colleagues and I conducted a study of the effects of an experimental translocation on the movement and activity patterns of common brushtail possums in New Zealand. This involved first capturing 12 ...
1
vote
1answer
22 views

P-value of Augmented Dickey-Fuller test and KPSS test

I would like to test if the time series of the US 3-month treasury bills (monthly data from 1934 to 2015) is stationary. I'm using the ADF test in R (from the package ...
1
vote
1answer
58 views

Linear model coefficient negative in summary but positive in plot

I am an R beginner, so sorry if I missing something basic. I did a linear fit with 2 input variables and 1 output. Plots of the output vs each input show a clear positive slope for each. However, the ...
0
votes
0answers
13 views

permanova or non-parametric test for multiple explanatory variables and interaction

Hi I am trying to find a test to analyse the following data set. Response variable is failure or success (0 and 1) measured over 4 time points, under 2 different treatments (light and temperature) in ...
0
votes
1answer
27 views

Interpretation of log(1 + var) transformed predictor

Interpretation of log transformed predictor neatly explains how to interpret a log transformed predictor in OLS. Does the interpretation change if there are 0s in ...
0
votes
0answers
6 views

Spearman correlation optmization

I need to compute Spearman correlation between two vectors. One vector is fixed, the other depends on k variables. I need to find set of variables {l1..lk} so that Spearman correlation is maximized. ...
2
votes
2answers
33 views

Changing the sequence of variables in a random forest model changes the classification accuracy

I find that the classification accuracy of the random forest model changes when the sequence of the input variables change. E.g. ...
6
votes
1answer
277 views

Understanding QR Decomposition

I've got a worked example (in R), that I'm trying to understand further. I'm using Limma to create a linear model and I'm trying to understand what's happening step by step in the fold change ...
0
votes
0answers
19 views

Richness presence bacteria

I need to find the richness, dominance and diversity about the presence of a bacterial population in different treatments. Is possible to make the calculation about the richness, dominance and ...
3
votes
0answers
64 views

Maximizing log-likelihood in R

I am trying to perform ML estimation for a continuous distribution given by \begin{align} F(x;\Phi)=\left(1-e^{-\eta^{k}(x)}\right)\left(1+\lambda e^{-\eta^{k}(x)}\right), \quad x > ...
0
votes
0answers
16 views

R - Variation of “How to plot decision boundary of a k-nearest neighbor classifier” [on hold]

This is a question related to How to plot decision boundary of a k-nearest neighbor classifier from Elements of Statistical Learning? I've been playing with that example, and would like to try to ...
0
votes
0answers
39 views

How to do an analysis of variance?

I ran an experiment in which probands had to rate (1 = dislike, 5 = like) how much they liked each of five fruits (apple, peach, orange, banana, strawberry). I now have results: ...
0
votes
1answer
41 views

Non parametric analysis

The my dataset is not normal distributed. In order to apply a non parametric analysis, exist only the Kruskal Wallis test or others? I need to find a test similar to ANOVA to apply a dataset not ...
6
votes
1answer
35 views

What are the differences between Ridge regression using R's glmnet and Python's scikit-learn?

I am going through the LAB section §6.6 on Ridge Regression/Lasso in the book 'An Introduction to Statistical Learning with Applications in R' by James, Witten, Hastie, Tibshirani (2013). More ...
0
votes
0answers
19 views

Calculating Cumulative Hazard Function [on hold]

Why are not hazard.km and quantile.km functions working in R ? ...
1
vote
1answer
35 views

Need help selecting appropriate statistical method for animal study

I could use some help deciding on the proper statistical method for a current experiment. The experiment is setup as follows: Independent Variable: Diet (4 groups of 10 for a total of 40 animals) ...
0
votes
0answers
10 views

How do I conduct model validation with glm models that have proportional response variable?

I would like to determine which environmental factors influence turtle nest survival. I ranked glm models with AIC using a step-wise procedure. The response variable is the proportion of eggs that ...
0
votes
0answers
13 views

Error Output - Wrong model type for regression

I am trying to constructs an Learning Vector Quantization (LVQ) model. ...
0
votes
1answer
11 views

R: Coping with bad model fit convergence during bootstrap

I'm running into trouble while checking the robustness of a GLM using the bootstrap procedures in R. Basically I want to check whether the estimated coefficient estimates of an existing GLM that I've ...
0
votes
0answers
4 views

Collapse duplicate rows by median value in R [migrated]

I have a date frame with two columns. I would like to remove rows where there are duplicate entries in the first column. however I would like to select a specific row to remain based on the value of ...
0
votes
0answers
19 views

“CFINDER” output data importation and calculation of mean of pairs [migrated]

I face a problem: I have to import a text file (from_soft.txt, which is output from "CFINDER" software). It looks like this: ...
0
votes
0answers
78 views

What does the following ACF curve mean ? (Picture attached)

I was checking for seasonality and other dependencies and this is the curve I get . There's no apparent seasonality....but what exctly does the falling slope mean? Any help would be appreciated. ...
0
votes
0answers
18 views

Cointegration in R - Standard error, test statistic and p-value of weights

I'm using urca package in R version 3.2.1. I used ca.jo function on a set of I(1) regular time series variables - taking two at ...
0
votes
1answer
24 views

Correlation coefficients of a time series

I have 100 simulations of an ARMA(1,2) process, created with R is such a way: ...
0
votes
0answers
7 views

Is a Mixed type III anova appropriate for unequal N data? How does one run this analysis in R?

I have a dataset from a psychological experiment that consists of three repeated measures of responses to different kinds of items 'variable', as well as two between-subject IVs, 'condition' and ...
1
vote
0answers
16 views

R square change for 2-way interaction model

I want to test a regression model with neuroticism as focal predictor, agreeableness as moderator and RT variability as dependent measure (covariates: attentional control and mean RT). Previously, I ...
0
votes
1answer
14 views

One main effect and one interaction in R using multiple regression, is that possible? And why am I getting two interaction terms in output?

I have two factors that are fully crossed, the levels of the factor are each coded 0 and 1. I am running a regression testing for one main effect and one interaction. The following is my logistic ...
0
votes
0answers
19 views

Time-series cross-sectional classification problem

I have a time-series cross-sectional dataset consisting of 100 individuals that each had 4 features measured yearly for 21 consecutive years. One of the features is binary and the other three are ...