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 program in `R`.

learn more… | top users | synonyms

0
votes
1answer
33 views

Exploring dependencies between variables in log-linear models

Hi there I'm using R to perform some multivariate data analysis on health data. I'm currently using the glm() function with ...
3
votes
2answers
182 views

From SAS to R - what are “must” packages for reporting

One big advantage of SAS over R is arguably its ability to produce quite complex reports with few statements; think of PROC SUMMARY or ...
0
votes
0answers
12 views

What is the difference between the M5 regression model tree and the Cubist method for regression?

I am aware of how the M5 regression model trees work. I know that they fit linear regression models at every leaf of the regression tree and that every parent in the node is also associated with a ...
1
vote
0answers
14 views

Determine size of quadrat by point pattern analysis

I'm working with a considerably large spatial point dataset that is irregularly spaced. As I want to average the data based on a particular quadrat size (essentially square grids) I was wondering if ...
0
votes
0answers
25 views

Regarding analysis of regression result and vif result

I am working on building a regression model. There are 51 points. The number of predictor variables is 37. The following is the result of running lm result. When trying to detecting the ...
0
votes
0answers
4 views

Optimal assignment of values in for loop to vector [migrated]

I have written code to generate a sequence of values A01, A02, A03, A04, A05, B01, B02, ..., G04, G05. I know that in R we usually don't like to use for loops. ...
0
votes
1answer
26 views

Expressing beta estimate in terms of odds ratio for a continuous variable

I am making a table from results of an analysis using generalised linear model which involves detecting association of a categorical predictor variable over multiple outcome variables. Of those ...
4
votes
1answer
39 views

Algorithm does not converge in R

I am doing a logistic regression in R, where I am modeling how potholes and weather correlate to accidents. When I run a logistic regression, I get the message "Algorithm does not converge" The ...
1
vote
1answer
28 views

Calculate PCoA scores for dataframe “x”, based on the distance matrix of dataframe “y”

I'm trying to use multivariate techniques to compare two datasets (same structure) that were collected using different sampling techniques. I'd like to compute a PCoA for the first dataset (D1), and ...
3
votes
1answer
63 views

Are these data underdispersed? If so, what mechanisms may explain this?

Say someone who is well practiced (appears to have reached a performance plateau) shoots 20 free throws on 15 different days and is successful the number of times shown in the upper histogram (...
0
votes
0answers
5 views

How to automatically skip over errors in r [migrated]

I'm trying to create new variables from some output from a number of two-piece segmented regression models that I'm running. The code for my new variable is: ...
6
votes
2answers
157 views

R t.test … NOT significant anymore

I got very confused while looking at help examples of the t.test function ...
1
vote
0answers
18 views

get p value based on observed F and critical F

When conducting multiple comparisons, I can calculate a critical value via whatever method is appropriate for the situation. If the adjustment method I need is a common one such as Bonferroni, I can ...
0
votes
1answer
46 views

Single EM imputation with R (using Amelia or other packages)

I am trying to impute missing values with R. I would like to use the EM algorithm for that. As it seems this algorithm is implemented in the ...
0
votes
0answers
10 views

sep option in read table data input [migrated]

I am reading data via the read.table function in R. How can I deal with varying field separations? i.e., one OR two whitespaces between columns of the table.
0
votes
0answers
25 views

Does a linear model make assumptions about distributions of depended and independent variables?

As the title says, does a linear regression model make assumptions about distributions of depended and independent variables and what should these distributions be for the model to work as expected ? ...
1
vote
0answers
36 views

What's wrong with t-SNE vs PCA for dimensional reduction using R?

I have a matrix of 336x256 floating point numbers (336 bacterial genomes (columns) x 256 normalized tetranucleotide frequencies (rows), e.g. every column adds up to 1). I get nice results when I run ...
0
votes
0answers
9 views

How to make a dataframe with missing values in R [migrated]

I’m creating a data frame by referring to output values from a large number of segmented regression models that I’m running, each with different initial breakpoint estimates. In some cases, the models ...
0
votes
0answers
13 views

Different variable importance results with stabsel and mboost

I'm using glmboost in the mboost package to fit a boosted regression using linear models as the base learner. There are 13200 observations and about 75 variables, ...
0
votes
0answers
14 views

R: selecting appropriate fit statistics from GBM output

I'm using the gbm.step function in the dismo package in R to evaluate the contribution of three continuous variables on my ...
1
vote
1answer
40 views

Reporting an ANOVA with a continuous predictor (multiple regression)

I have a design involving 1 between-subjects categorical factor, 1 between-subjects continuous factor and 2 within-subjects categorical factors. This is theoretically a case of multiple regression, ...
0
votes
0answers
27 views

Why inverse of 'predict' function in r can not be used for dependent variable prediction in linear model

When a regression is calculated with a simple linear model that returns intercept and slope for an equation like this y=a + bx one can predict y (the response variable) based on that equation. Equally ...
1
vote
0answers
15 views

Post hoc non-parametric tests in R [closed]

I ran a Kruskal-Wallis in R (on four different groups with unequal sample numbers) and found a significant difference. I have read that a Dunn's method test as a post hoc can be done, but I have no ...
0
votes
0answers
18 views

R implementation of Zeger's parameter-driven (latent process) approach to time series regression with count data

For time series regressions with count data, Poisson-response with log link (i.e. GLM) is widely used. However, such models often suffer from serial correlation. One approach to handle was introduced ...
2
votes
1answer
60 views

Difference between svd() and prcomp() in R

Conceptually, aren't the eigenvalues of a correlation matrix and the singular values of the associated scaled data matrix supposed to be the same? The below illustration is saying that it isn't so. ...
1
vote
2answers
93 views

Unusual linear regression results in R

I am doing multiple linear regression analysis in R and I got the following summary: ...
3
votes
2answers
38 views

How to determine overlap of two empirical distribution based on quantiles?

I'm looking for a method to calculate "threshold" at which the $\alpha^{th}$ quantile of one empirical distribution is equal to the 1-$\alpha^{th}$ quantile of another empirical distribution. I had ...
5
votes
2answers
49 views

Appropriate method for determining difference between means?

I'm looking at the calling rate of bird species when prey availability is altered. So there are two groups, a control (no manipulation) and experimental group (where prey has been increased). I'm ...
0
votes
0answers
29 views

fitting garch (1.1) model in r or eviews

How I can have positive GARCH (1.1) parameters value using "R" or "eviews" by taking a dummy variable. Following are my data and how the dummy looks like. So I need to calculate GARCH (1.1) parameters ...
0
votes
0answers
22 views

Negative variance component of random effect

I encountered a problem related to negative variance component of random effects ( I think SAS and R both constrain these negative values to zero) in mixed model. Almost 5 out of 20 variables in my ...
1
vote
1answer
72 views

Arima time series forecast (auto.arima) with multiple exogeneous variables in R

I would like to conduct a forecast based on a multiple time series ARIMA-model with multiple exogeneous variables. Since I am not that skillfull with regards to neither statistics nor R I want to keep ...
-1
votes
0answers
22 views

Which clustering technique to use for mixed data

I want to do segmentation of my customers based on certain attributes. My data contains a mix of categorical (such as industry, products used, risk category, etc.) and continuous variables (such as ...
1
vote
1answer
44 views

Efficient convolution (in R)

I want to calculate/evaluate the convolution $$g(x)=\int_D f(x-t) \phi(t) dt,$$ where $f$ is a density and $\phi$ is a smooth function with compact support $D$. The convolution is not available in ...
3
votes
1answer
129 views

Simulating the waiting paradox

After seeing this question, I thought I would try to simulate the bus waiting time paradox to help my understanding. However, what I got was the "intuitive" result, rather than that predicted by the ...
1
vote
1answer
29 views

How can regression trees be fit in WinBUGS/OpenBUGS/JAGS?

There is an R package called BayesTree which can fit regression trees in Bayesian environment. However, this way only simple regression is possible. I would like to use regression trees as a part of a ...
0
votes
0answers
56 views

Cross Validation to find Misclassification rate of Explanatory Variables

I am trying to create a function that will allow me to identify which explanatory variable (x) in a logistic regression of a data set has the lowest rate of error in predicting a response variable (y) ...
0
votes
0answers
18 views

Fixed or Random: Hausman test plm vs LRT lmer, Which is the best approach to decide to use random effect?

I have an unbalanced panel data and would like to know which method is better for estimation if I want to capture the heterogeneity of the sample using the plm package or lme4. The sample have year ...
2
votes
0answers
22 views

Classifying points in subspaces

I have a set of points in 5D and I am building a classifier. There are five classes. One interesting property of the data is that points in each class tend to be located in, or near, a 1D, 2D or 3D ...
0
votes
0answers
31 views

Cross validation of result from glmnet [closed]

I am trying to experiment with glmnet for building the regression model. The cross validation result is shown in the following figure. Looks like to me that mean-square error is totally out of ...
0
votes
0answers
26 views

Simplifying explanatory model using Vegan adonis in R

I am a newbie to multivariate statistics, so please forgive me if this question is naïve, or if I have missed something important. I'd like to know whether it would be valid to approach using adonis ...
1
vote
0answers
51 views

time series forecasting with 53 weeks in a year

I am building a time series model in R. I have four years of data from 2010 to 2013 and doing forecasting fro 2014. According to the calendar that my organisation follows, In 2014 , there would be 53 ...
1
vote
1answer
46 views

R: partial dependency plots from GBM package. Values and y-axis

I'm using the gbm.step package in R to look at the influence of three continuous variables on my continuous response variable. I have 234 observations. The model: ...
4
votes
1answer
184 views

R: equivalence between an aov between-within repeated measures model and an lmer mixed model

I have some trouble obtaining equivalent results between an aov between-within repeated measures model and an lmer mixed model. ...
6
votes
1answer
102 views

Should auto.arima in R ever report a model with higher AIC, AICC and BIC than other models considered?

I have used auto.arima to fit a time series model (a linear regression with ARIMA errors, as described on Rob Hyndman's site ) When finished - the output reports that the best model has a (5,1,0) ...
0
votes
1answer
69 views

When should I use nonlinear-regression model

I have the following table: ...
0
votes
0answers
53 views

Data Research Tool For Statistical Analysis and Data Exploration

I'm about to embark on a data analysis project that will involve the following activities: Build a database that includes approximately 5 to 6 tables (sql) or collections(nosql) Building queries for ...
0
votes
0answers
20 views

Align Boxplot and Barplot in R [migrated]

I am very new to R. For my studies i need to plot the number of animals I found during 16 transects into a boxplot and a barplot. I want to combine both plots to one image using mfrow. The x axis ...
0
votes
0answers
26 views

How to increase Accuracy in Age model on Mobile operator dataset (Call log)?

I know question is too lengthy, but it need description. I am currently working on predictive analysis project. Which predict customer age, gender, etc. demographics attributes from their data set. ...
0
votes
0answers
7 views

Quantile normalize a single column in R [migrated]

I have a column in my dataframe in R, data$height. The values range from 0- 400. I want to normalize the values in the column such the resultant values lie between 0-1 and are quantiles, i.e the ...
1
vote
2answers
125 views

Is it fine to get this results in binary logistic regression?

I wanted to check whether the level of satisfaction relates to the level of support to the value of democracy. Dependent variable (support) is binary variable (Good/Bad) and independent variable is ...