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

2
votes
0answers
9 views

Comparison of Bernstain and Chebyshev inequalities applied to Bernoulli distribution - simulation in R gives unexpected results

I'm trying to compare Bernstein and Chebyshev inequalities applied to Bernoulli distribution with parameter $p$. More specifically - how good are bounds they give for different sample sizes. I wrote ...
0
votes
0answers
3 views

RSNNS neural networks, checking percentage correct.

For those who have some experience with RSNNS, I'm trying to build a neural network for reading aloud, using RSNNS in R. To give some information about what I'm doing and using. I'm using orthographic ...
1
vote
0answers
15 views

Overfitting of Regression with Robust Variances?

I performed regression with robust variances (after Stata 12.1 lnskew transformation). A question of overfitting has been raised. To summarise what I did: [1] Comparison of BrS (disgrp=2) vs ARVC ...
0
votes
0answers
8 views

Why are standard errors the same in lag-distributed model in R?

I am running a lag-distributed model ordinary least squares in which a set of units are all treated in the same year. I am including a 2 lags and 2 leads to see if there were any "anticipation" or ...
0
votes
0answers
10 views

Svm for survival analysis in r [on hold]

Is there any implemented package for survival analysis with SVM in R? I need to feed the model with both survival time and event. Thanks!
2
votes
0answers
22 views

Get survival rates from a cox regression in R

I am fairly new to survival analysis and am playing around in R. I have a fairly simple cox model ...
1
vote
0answers
10 views

Efficient Triangular Backsubstitution in R [migrated]

I am interested in solving the linear system of equations Ax=b where A is a lower-triangular matrix (n $\times$ n) and b is a (n $\times$ 1) vector where n $\approx$ 600k. I coded up backsubstitution ...
0
votes
0answers
10 views

How to minimize setup cost in linear programming model using R [migrated]

Suppose we have a matrix m: > m C1 C2 M1 70 80 M2 50 61 M3 45 40 with machines M1-M3 and customers C1-C2. The values indicated the product volume that each ...
0
votes
2answers
21 views

Tests of heteroscedasticity in linear regression models

I am unfamiliar with the implementation used in the R package GVLMA. What are some basic tests of heteroscedasticity in linear regression models and how or where ...
0
votes
0answers
17 views

How is the entropy calculated by the `entropy` package in R?

So, as per the docs, I'm calling the function like this v = c(0,4,3,6,7,3,2,3,4,5) entropy(discretize(v, numBins = 8, r = c(0,7))) and I get ...
0
votes
0answers
6 views

Convert coordinates to neighbor list for spatial analysis in R using INLA [on hold]

I am trying to do an analysis of two greyscale images taken a few seconds apart, where each pixel in the first image should be predictive of the pixel in the second image. In general pixels near each ...
3
votes
0answers
44 views

logistic regression in r with many predictors

I have been running logistic regression in R, and have been having an issue where as I include more predictors the z-scores and respective p-values approach 0 and 1 respectively. For example if have ...
0
votes
0answers
7 views

Using gbm to eliminate variables before glm

I have a classification problem I am attempting to model using logistic regression (via the glm package in R): ...
0
votes
2answers
25 views

Computing R-squared change, F-, and p-values for the interaction / moderation term [on hold]

I would like to compute R-squared change for the interaction/moderation term in a multiple regression model, along with the corresponding F- and p-values. Previously, I have worked with the modprobe ...
6
votes
2answers
192 views

nonlinear regression two equivalent models on paper, but different estimated parameters

I measured one response variable Y1 as a function of two measured independent variables X1 and X2 It is common practice in ...
0
votes
0answers
6 views

correct for temporal autocorrelation in mantel tests

Hej, I want to compare the community composition of a bacterial assemblage with it's resource use ability. therefore I calculate a distance matrix based on the community composition and a distance ...
2
votes
0answers
31 views

Simple importance sampling example: What am I doing wrong?

I am learning about importance sampling and trying undertake importance sampling on a trivial example, but failing to get the right answer. I have read various PDFs online, and the relevant section of ...
0
votes
0answers
31 views

What kind of data types are best to work with prediction algorithms of R

Assuming the data is tidy and it has a mix of columns of type numeric, character and Factor. What is the data type that would give best results when using different prediction techniques in R? I am ...
1
vote
0answers
22 views

Best SQL package for R [on hold]

I am starting programing in R and I am struggling with data manipulation. I am quite fluent in SQL so it would be easier if I could work with a SQL package. Which package would you advice? And why? ...
0
votes
0answers
18 views

Multivariate polynomial regression including standard deviations (R)

I'm wondering if there is a way to take into account initial standard deviations when looking for a polynomial regression. I mean, I want to fit a polynomial like (in R): ...
0
votes
0answers
45 views

Marketing Data with many zeros

I am working on a marketing data which is a time series data with marketing spend done through different channels and revenue generated. The data looks like this : My data contains too many zeros ...
0
votes
0answers
15 views

What is a good test for comparing frequency counts between two groups?

I am looking for statistical methods used to compare frequency of observations between two groups. I have two geographical locations with data on different soil types present. for example, my data ...
0
votes
0answers
13 views

R and MATLAB: Line Plot with Layered Categorical Variables [on hold]

I'd like to reproduce the graph in the attached figure in R and MATLAB. Note that the x-axis contains categorical variables (hour and day). There could be multiple lines in the y-axis (e.g., the ...
2
votes
0answers
30 views

Spearman's rank correlation has p-value zero?

It looks like R's cor.test returns p-values of exactly zero if the real p-value is very low. For example: ...
0
votes
0answers
14 views

Prediction in mlogit [on hold]

I'm trying to use mlogit and predict the choices for my data. My data is: ...
0
votes
0answers
12 views

Permutation to test SNP interactions

sampleID case/ctrl var1 var2 var3 var4 var5... sample1 0 1 0 0 1 0 1... sample2 1 0 0 0 0 1 0... sample3 0 1 1 1 0 0 0... sample4 1 0 0 0 0 1 0... ... case/ctrl status is binary, variant status is ...
0
votes
0answers
20 views

R - Outlier detection multivariate in R [duplicate]

I'm looking for few R packages to detect outliers from a multivariate data frame. In the following Dropbox link you can find an example of data. Columns 1 to 5 are the variables and the 6th the label. ...
0
votes
0answers
2 views

Similarity measurement akin to SMAPE

I have two questions: A) Is there an official name for average of the smaller number over the larger number? B) Why have SMAPE range from 0 to 2? Isn't a range from 0 to 1 superior for understanding? ...
1
vote
0answers
7 views

Propensity score matching for “large” datasets - smarter solution than nearest neighbour?

The following question has some programming / software package as well as some numerical aspects, but I would consider it a statistical question at heart - I hope you agree. I am trying to do 1:1 ...
1
vote
2answers
38 views

Linear correlation between two sets of data

I have various data sets that correspond to values (in percentage) at given time points (hours, up to 10 hours). The total number of data sets of values at given time points is 8. My question is ...
0
votes
0answers
19 views

Getting an error message “Error in if(reached.threshold < min.reached.threshold)…” while training network using neuralnet package

I'm using R to create train and test a neural network on a time series (the annual sales of a company over a large period of time). As using the package's default learning algorithm (resilient ...
0
votes
0answers
15 views

Transforming independent variables in R [duplicate]

Is there a way through which we can determine how can we transform our independent variables to increase linearity. I am aware of boxcoz function but it provides information on transforming dependent ...
0
votes
0answers
29 views

R: Time series forecasting alternatives to ARIMA [on hold]

I was using WEKA to perform time series forecasting based on lagged variables and machine learning algorithms: Time Series Analysis and Forecasting with Weka I am trying now to do something similar ...
0
votes
0answers
5 views

Decimal delimiter using write.table [migrated]

I'm trying to output data in R using the following command: ...
0
votes
1answer
17 views

3way between subjects Anova with Unbalanced samples

I would like to perform robust 3-way ANOVA using the WRS package in R. The very first requirement is to cast the data into wide format. Hence, I have wide format data frame with unbalanced rows in ...
0
votes
0answers
14 views

Forecasting with Dynamic values using R [migrated]

I have a Json object : {"tcDetails":[{"project_nm":"abc","id":"1","n_tc":"32","TC": [{"29/06/2015":50,"30/06/2015":45,.....}] {"level":[{80,85,90,95}]}]} ...
1
vote
0answers
8 views

effect estimate without constant variance (r sandwich vcovHC)

For the sandwich package in R, when using vcovHC(model) where model <- lm(Y~X), what gives the effect estimate regarding the ...
0
votes
1answer
27 views

Clustering using gower distance in R

I have a dataframe which has categorical and numeric variables. I want to cluster this data using gower distance and get cluster values as a vector as in kmeans function. How can i achieve that?
0
votes
0answers
14 views

Not able to make daily time series analysis in R [on hold]

The following is my data, ...
4
votes
2answers
74 views

How to simulate censored data

I'm wondering how can I simulate a sample of n Weibull distribution lifetimes that include Type I right-censored observations. For instance lets have the n = 3, shape = 3, scale = 1 and the censoring ...
0
votes
0answers
16 views

CausalImpact - Is pre-processing of covariates required?

I'm using the CausalImpact to evaluate the effect of a programme. My covariates are seasonal and I wonder whether I need to deseasonalise/ detrend the regressors before using the R package? Hal ...
0
votes
0answers
36 views

Set zero axes in R [migrated]

How can one force the visualisation of the zero axes $y=0, x=0$ in R, removing the external ones siding the plot? I want to obtain the same effect that one can have for example in Gnuplot with ...
1
vote
2answers
62 views

Weibull Survival Model in R

If I run a Weibull survival model in R with the code survreg(Surv(t,delta)~expalatory variables, dist="w") how do I interpret the output of the model? That is, ...
0
votes
0answers
10 views

customized bsts model CausalImpact

I'm using the CausalImpact & bsts package to evaluate the effect of a programme. My problem is that in a model with regressor component the command ...
2
votes
0answers
12 views

Polygon pattern analysis -> point pattern analysis?

Is it correct to convert polygons to points in order to do a point pattern analysis ? I have a set of polygons that tend to be clustered around roads in a study area. I just want to show this fact. ...
1
vote
1answer
24 views

Feature selection with genetic algorithm in R [on hold]

I'm looking for a R-package that does feature selection using a genetic optimization algorithm. I couldn't find one on CRAN and I wonder whether there is a free one. I would be very appreciative for ...
0
votes
0answers
12 views

If doing a meta-analysis with R, using log hazard ratios, do I supply the variance/SE or the log variance/SE? [duplicate]

As above, really! I have a load of trials for which I have the HR, the standard error of the HR, and n. I can either supply the variance with vi=(SE*sqrt(n))^2 or ...
2
votes
1answer
31 views

Three-ways Kruskal-Wallis test [on hold]

I need to make a Kruskal Wallis a three ways. The my dataset is composed by x (Presence) and three variable. I want to see the statistical difference of my x versus all the factors. I try to apply the ...
1
vote
0answers
15 views

Cost/Benefit of BootStrapping CIs for dependent samples, but unequal number of observations

In the experiment, subjects were equally exposed to two conditions: 100 of condition_a and 100 of condition_b. A pre-determined response criteria created an unequal number of observations. Thus, no ...
2
votes
2answers
29 views

two-sample t-test VS two one-sample t-tests. What's the difference?

I have dataset which contains values of some numeric variable for two independent groups: ...