Tagged Questions

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
0answers
3 views

Gibbs sampling scheme on Ozone35 data set [migrated]

I'm attempting to run a Gibbs sampling scheme on the data set Ozone35 from the BayesVarSel package in R. Here is the info on the data set Ozone35: ...
0
votes
0answers
6 views

seqinr dotplot - change axis [migrated]

I have to datasets: seq1 and seq2 (DNA sequences). I wanted to do a dataplot, comparing the two sequences and placing a dot where the two sequences match. I was able to accomplish this using seqinr's ...
0
votes
0answers
11 views

How to decorrelate residuals in r from the covariance matrix

I fit a geeglm model with clustered data and now I would like to decorrelate the residuals of the model in order to run model diagnostics. I read that if I can obtain the covariance matrix of the ...
2
votes
1answer
68 views

Wrong Intepretation of Kruskal Wallis Test in R

I have some data (called egecNonmated) in R and I am trying to show that the distributions of a variable (MatchScore) are identical across three different Categories (Cat). I am using a box plot to ...
0
votes
0answers
21 views

How to perform Friedman's test with covariates

I have 500 participants who each completed 30 trials. In each trial they need to choose the correct image out of three (a three-alternative forced-choice task). Of these thirty trials, 10 trials ...
0
votes
0answers
12 views

Why does the regression model tree consider only those parameters along the path for the model?

When we try to model a regression tree by the M5 approach, while building the model at a particular leaf node, we consider only those variables that have been on the path from the root node to this ...
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
181 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
11 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
8 views

Adjusting Daily return in Quantmod [closed]

I downloaded the daily returns of stocks in R from quantmod package. I see that the lowest daily return of AT&T is showing as -77% which is little hard to believe. I checked the historical prices ...
0
votes
0answers
24 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
26 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
62 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
156 views

R t.test … NOT significant anymore

I got very confused while looking at help examples of the t.test function ...
1
vote
0answers
16 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
42 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
33 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
12 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
13 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
26 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
14 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
17 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
90 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
48 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
27 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
21 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
68 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
128 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
26 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
52 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
15 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
19 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
43 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
181 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. ...