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

Parallel processing in R saving plots [migrated]

I have a code in R to perform classification and estimation( using regression modeling) on 60 data sets using random forest algorithm and at the end of it there is a plot to show how a quantity ...
0
votes
0answers
4 views

SVM Brier Score unreasonably better when estimating probabilities through PAVA instead of Platt Scaling?

I've been studying (and applying) SVMs for some time now, mostly through kernlab in R. ...
0
votes
0answers
12 views

Exact formula Yates' correction in R

If I run a chi square in R with the Yates' correction, I get slightly different results from doing it by hand. What is the exact formula R is using for the Yates' correction? I use the simple code: ...
0
votes
0answers
4 views

Correlation is moderate but Path coefficients (in pls-sem) show insignificant results

I am performing PLS-SEM analysis (usng plspm package), the outer loading's are significant as CI do not include zero on any of them However, large number of path coefficient's (i.e, inner model)are ...
0
votes
1answer
4 views

Simulate ARIMA Model in R using same starting values as original time series?

I have built an ARIMA model in R with the forecast package's auto.arima() function. I want to simulate the ARIMA model with the same starting values as the original time series. For example, if my ...
0
votes
0answers
4 views

Regarding pattern recognition and forecasting next set of sequence [on hold]

I have been working on use case where I have some sample data as below : Date Device Name Time Facility Code 1/6/2015 Tablet X 16:18:48:168 22 A 1/6/2015 Tablet X 16:18:50:41 ...
0
votes
0answers
14 views

How can I find the variance components from a MCMCglmm output?

I have a dataset in which birds (n=55) were measured twice for five different behaviours. I am now trying to statistically test if individuals are reapeatable/consistent in their behaviours or not. I ...
0
votes
1answer
19 views

Simulation of time series with R [on hold]

I'm new on time series. I'm trying to solve an exercise on the simulation of an ARMA process. The problem is the following: Generate 100 simulations, each with n=60 elements of an ARMA(1,2) process ...
0
votes
0answers
6 views

Package ‘JPSurv’ - Trends in incidence rates [on hold]

Has anyone ever used the JPSurv package in R to look at trends in incidence rates? The original software put out by the NIH - Joinpoint - is not compatible with my computer (a macintosh) and so I ...
0
votes
0answers
7 views

Error when using Irlba function in R? [on hold]

irlba(A=X, nu=2, nv=2) Error in matrix(0, m, m_b) : non-numeric matrix extent In addition: Warning messages: 1: In min(m, n) : no non-missing arguments to min; returning Inf 2: In min(n, m) : no ...
1
vote
1answer
15 views

Bars or Boxplot

For my thesis work I need to plot data as dry mass content, Brix, sugar content, etc., of 12 genotypes of onions. My question is, what is convenient to use, barplots or boxplots? Personally I like ...
1
vote
1answer
15 views

R - Multivariate K-nearest neighbor outlier detection

I'm trying to implement the algorithm K-nearest neighbor to detect outlier from a multivariate dataset. I don't know how to do it. Could you provide me some example?
1
vote
1answer
17 views

How to check if the correlation between two continous variables is influenced by a categorical factor?

I have a data frame (df) where I see correlation between two continuous variables (c1 and c2). I need to know whether the observed correlation between the two variables differs between groups, which ...
0
votes
1answer
33 views

what does the minus sign mean in the function definition in R [on hold]

I am reading a tutorial and I found a function definition in R ...
-1
votes
0answers
9 views

Brand based aggregation Fundamental

I am looking to do brand based aggregation on our audience (Brand based clusters tell you what brands people like). I have the following data about our customers. ...
0
votes
1answer
46 views
0
votes
0answers
28 views

Graph with 3 variables in R? [on hold]

I have some data with 3 variables: x = position y = length z = number Here is an example: x y z 12 40 8 13 40 8 14 40 8 15 40 5 16 24 9 I'd like to ...
0
votes
1answer
52 views

Improving a logistic regression model in R [on hold]

I have to devise a model in R, capable of predicting the type of a disease, which is a categorical dependent variable (three possible values), through several continuous and categorical, some of the ...
0
votes
0answers
6 views

Inverse probability weighting (IPW): standard errors after weighting observations

When using propensity scores for inverse probability weighting (IPW) the standard errors for the parameters in the regression model may be affected. I have seen several examples of people using ...
-1
votes
1answer
36 views

Normal distribution in R: Find the value of $x$ for $P(X=x) = c$ where $c$ is known

I have a normal distribution with parameters $\mu=750$, $\sigma=260$. I'm interested in finding the value of $x$ that satisfies $P(X=x)=0.001$ for both sides of the tail. How would I go about doing ...
0
votes
0answers
16 views

How can I extract a residual variance-covariance matrix in lme?

I have been using MCMCglmm in R to fit bivariate (two response traits) mixed models in R, but now I need to move to lme to account for temporal autocorrelation of the residuals. In MCMCglmm I can fit ...
2
votes
0answers
24 views

Fitting nonlinear meta regression models to data

I have a collection of data, obtained from different studies. To plot the ratio of means against different CO2 concentrations, I used a random effects model with a continues predictor (the CO2 ...
0
votes
0answers
10 views

loop ordinal regression statistical analysis and save the data R [on hold]

I am relatively new to R. The short version of the data looks ike this: ...
0
votes
1answer
45 views

Multivariate OLS - Partialling Out

I have bee wondering why in a multivariate OLS-Regression it is not possible for R² to decrease when increasing the number of explanatory variables. The Point is that for example in the model ...
0
votes
0answers
20 views

How to choose which test to use to determine if a time series is non stationary?

I want to determine if my time series is non stationary. I looked many articles and have learned there is not just one formula - ADF. It seems you must use some series of tests and assumptions. But I ...
0
votes
0answers
13 views

Bayesian random effects meta-analysis on the risk ratio with r2jags

Following the work of Warn 2002 I am trying to set up the model for a Bayesian meta-analysis on the risk ratio and the odds ratio. I am using R together with R2jags to fit a simple RE MA model. ...
0
votes
0answers
21 views

Failed to reduce deviance while using “lme4 : glmer ”

this is my first post, so I will try to make it as clear as possible. Hopefully is not something trivial and I am just stuck. I am performing meta-analysis using the glmer function of the lme4 ...
1
vote
1answer
32 views

lavaan WARNING: could not compute standard errors!

I have a problem. I use r package "lavaan" to make confirmatory analysis. I run the following code: ...
0
votes
1answer
17 views

Forecasting with no seasonality

I have a set of data, let's say average weight of employees, captured every month over a period of 5 years (2010 - 2014). I cannot find a seasonality trend in the data over these years. Also, I have ...
-1
votes
1answer
17 views

Functional clustering with R [on hold]

I have a time series data in R, and I am using functional clustering. I would like to interpret a figure that is output below the code. Furthermore, I would like to control line colors and thickness ...
0
votes
0answers
9 views

stepwise discriminant discriminant analysis with r [on hold]

how do a stepwise variable selection before the discriminant analysis, using the Wilks' lambda criterion, with r? can anybody show me the code? thx
0
votes
1answer
17 views

How to group data into already known centers of clusters in R?

I have a table of GPS data and I need to associate each record to the closest from a list of locations. It's like doing clustering but I already have the centers of the clusters. In this case the ...
0
votes
1answer
14 views

GAM summary F values

Does anyone know how the F values are computed in summary(gam.object). I've looked through the help page, and the gam package, ...
5
votes
1answer
31 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
1answer
12 views

How do I perform a Wald Test with multivariate Granger Causality Analysis

I am doing a Granger Causality Analysis for three economic variables (GDP, CO2 emissions and Total Energy Consumption) of Puerto Rico. I am using a Toda-Yamamoto Procedure implemented in R R. I am ...
0
votes
0answers
16 views

What does the sigma^2 figure mean when fitting a model to a time series in R?

I have a time series in R, and I am using the arima function to fit it to a SARIMA model. I would like to use the parameters it returns to write the time series equation by hand, but in order to do ...
0
votes
0answers
5 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
18 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
9 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
13 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
1answer
40 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
24 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
18 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
1answer
70 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
10 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
48 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 ...
7
votes
2answers
209 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 ...