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
1answer
72 views

Random Forest - What training set measure is the best predictor of test set accuracy?

I'm running a random forest model on a training sample in R in order to make predictions on a hidden test set. I'm having difficulty in understanding how I should go about improving my model in order ...
0
votes
1answer
28 views

How to create and improve a logistic regression model in R

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 ...
1
vote
1answer
78 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.) ...
0
votes
1answer
15 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
25 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 ...
26
votes
1answer
16k views

Interpreting plot.lm()

I had a question about interpreting the graphs generated by plot(lm) in R. I was wondering if you guys could tell me how to interpret the scale-location and leverage-residual plots? Any comments would ...
0
votes
0answers
5 views

Brand based clustering Fundamental

I am looking to do brand based clustering on our audience (Brand based clusters tell you what brands people like). I have the following data about our customers. ...
0
votes
1answer
42 views
0
votes
1answer
37 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 ...
2
votes
1answer
37 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 ...
0
votes
0answers
22 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 ...
3
votes
1answer
69 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 ...
-1
votes
1answer
31 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
1answer
40 views

Inverse probability weighting in logistic models - large weights irrelevant when using additional covariates?

I am using propensity scores for IPW in a logistic GLM in R. Two of the propensities are quite small and thus the resulting weights are quite large - much larger than all the others. I expected these ...
1
vote
1answer
203 views

What does the parameter $\alpha$ do in the Jaccard method for binaryRatingsMatrix in R recommenderlab?

What is the role of the parameter 'alpha' in the recommenderlab R package's use of Jaccard method in the recommender model for ...
0
votes
0answers
3 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 ...
22
votes
6answers
6k views

Is PCA followed by a rotation (e.g. varimax) still PCA?

I have tried to reproduce some research (using PCA) from SPSS in R. In my experience, principal() function from package psych ...
2
votes
0answers
19 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
1answer
24 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 ...
2
votes
1answer
174 views

Visualize process data

I have a dataset of order processing with 8 million rows with following columns: HistoryId - Identity column of the records ...
0
votes
0answers
8 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
0answers
13 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 ...
0
votes
1answer
12 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, ...
0
votes
1answer
107 views

Change settings in the prediction model (caret package)

I am using the package caret and GBM method for my predictions. ...
0
votes
0answers
13 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
11 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
15 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
0answers
16 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

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
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 ...
0
votes
0answers
27 views

Errors-in-variables multivariate polynomial regression (R)

(EDIT: the question has been modified just a little bit to be more specific) I want to fit a multivariate polynomial regression that accounts for measurement errors (an Error-in-Variables model). ...
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
1
vote
1answer
14 views

Solving “n” equations with 3 unknowns

I'm new to R and I'm trying to solve a system of equations. I have about 380 equations where i have 3 unknowns per equation. I can use three equations and solve by using "solve()" and it works great. ...
0
votes
1answer
10 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
15 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
1answer
125 views

Chow Structural Test in R

I am sitting on a pile of data concerning wages at a local company and other information, such as the gender, whether the person in question belongs to a minority group etc. What I would like to ...
130
votes
7answers
105k views

Difference between logit and probit models

What is the difference between Logit and Probit model? I'm more interested here in knowing when to use logistic regression, and when to use Probit. If there is any literature which defines it using ...
0
votes
1answer
53 views

Correct arguments for svm() function in R

I'm looking to implement a linear and non-linear SVM in R but having some confusion over which argument to use in svm(). For the linear SVM I want to add in the ...
1
vote
1answer
364 views

Replicating tables in van den Brink, P.J. & ter Braak, C.J.F. (1999) with vegan's prc

The paper is: van den Brink, P.J. & ter Braak, C.J.F. (1999). Principal response curves: Analysis of time-dependent multivariate responses of biological community to stress. Environmental ...
2
votes
0answers
20 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 ...
12
votes
4answers
35k views

R - QQPlot: how to see whether data are normally distributed

I have plotted this after I did a Shapiro-Wilk normality test. The test showed that it is likely that the population is normally distributed. However, how to see this "behaviour" on this plot? ...
0
votes
2answers
37 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 ...
2
votes
1answer
1k views

Proportion of explained variance in PCA and LDA

I have some basic questions regarding PCA (principal component analysis) and LDA (linear discriminant analysis): In PCA there is a way to calculate the proportion of variance explained. Is it also ...
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 ...
0
votes
2answers
23 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 ...
2
votes
1answer
190 views

Forecasting asset returns using index models in R

How do you forecast returns and the associated risk in R using index models? How do you represent risk in multi index models as a single value in R?
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
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
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!
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 ...