Tagged Questions

R is available on a wide variety of UNIX platforms, Windows and MacOS, and can be downloaded from CRAN. It is an implementation of the S programming language combined with lexical scoping semantics inspired by Scheme. R was created by Ross Ihaka and Robert Gentleman and is now developed by the R ...

learn more… | top users | synonyms

0
votes
1answer
29 views

Dirichlet process/Chinese restaurant process for clustering in R

I recently read a fascinating article describing methods for clustering data without assuming a fixed number of clusters. The article even includes some sample code, in a mix of Ruby, Python, and R. ...
-2
votes
1answer
30 views

Optim error - initial value in vmmin is not finite [closed]

I have run 'fitdistr(mydata, "Gaussian")' and get the following error message: Error in optim(x = c(34.513, 25.587, 18.251, 52.836, 38.206, 42.395, 47.22, : initial value in 'vmmin' is not ...
1
vote
1answer
28 views

How to run two-way ANOVA on data with neither normality nor equality of variance in R?

I am working on my master thesis at the moment and planned on running the statistics with SigmaPlot. However, after spending some time with my data I came to the conclusion that SigmaPlot might not be ...
0
votes
3answers
94 views

Filling NAs in a dataset with column medians in R

I have a massive dataset with titles across the top for the row. All the values in the dataset are number minus about 50 of them which are NA. I need to find the median of each column whilst somehow ...
5
votes
2answers
93 views

Is there a general method for simulating data from a formula or analysis available in R?

In designing an experiment or a survey, simulating data and conducting an analysis on this simulated data can provide terrific insight into advantages and weaknesses of the design. Such an approach ...
2
votes
1answer
86 views

What do additional arguments indicate in the simple.sim function in R?

In R suppose that we have the following code: require("UsingR") # required for "simple.sim" function below f= function(n=100,mu=0,sigma=1) { nos = rnorm(n,mu,sigma) ...
-1
votes
0answers
45 views

Ridge regression auto-normalization & CV

Is there a package in R that performs regularized regression (ridge, Lasso, LARS, etc.) that also: unit normalizes (i.e. scales and de-means) independent variables automatically AND uses ...
3
votes
0answers
75 views

Regularization L1-norm and L2-norm empirical study

There are many methods to perform regularization -- L0, L1, and L2-norm based regularization for example. According to Friedman Hastie & Tibsharani, the best regularizer depends on the problem: ...
1
vote
1answer
57 views

avova one way vs multiway

Hello I'm running anova with R and I am wondering what the differce is between multiway anova and single anova. I know single anova gives a different answer than multiway anova but I dont know how to ...
1
vote
0answers
25 views

Moving average of irregular time series data using R

I'm attempting to dig out some metrics that look at how reliably clients connect to a service. The raw data is in the form of "client A, came online|offline at time X". The connection is highly ...
0
votes
0answers
40 views

profile confidence intervals in R: mle2

I am trying to use the command mle2, in the package bbmle. I am looking at p2 of "Maximum likelihood estimation and analysis with the bbmle package" by Bolker. Somehow I fail to enter the right start ...
4
votes
1answer
52 views

How to get percentage agreement between a group of factor columns?

I have a data.frame with 18 columns all of which are categorical variables containing the same factors e.g. "a", "b", "c". What I would like to produce is a matrix which is 18x18 and contains the ...
0
votes
0answers
45 views

How to do cross join in R? [migrated]

How can I archive cross join in R ? I know known that "merge" can do inner join, outter join. But did not know how to archieve cross join in R ? Thanks
0
votes
2answers
23 views

basic anova for all columns

I would like to perform an anova for all the columns in my data set. I tried this: aov.ex2 <- aov(base~1*2*3,data=data1) summary(aov.ex2) results in 8 1 4.83E+08 482880306 29.802 ...
1
vote
0answers
28 views

What does “covariance risk budget” mean in fPortfolio package?

I have been using the fPortfolio package and have found some inconsistency in the usage of terminology in the package. What does a "covariance risk budget" in the result returned by mean variance ...
1
vote
0answers
21 views

Understanding the plm package - Why aren't my standard errors correct?

For fun, I tried to replicate the results of Petersen (2009) who deals with the correct estimation of standard errors in finance panel data sets. In a nutshell, he estimates the following standard ...
2
votes
2answers
66 views

dirmult package in R

I am trying to use the dirmult package in R to find the parameters of the dirichlet multinomial distribution. However When I run the code, I see that it appears to be minimizing the Likelihood rather ...
1
vote
2answers
81 views

What is a valid post-hoc analysis for a three-way repeated measures ANOVA?

I've performed a three-way repeated measures ANOVA; what post-hoc analyses are valid? This is a fully balanced design (2x2x2) with one of the factors having a within-subjects repeated measure. I'm ...
-1
votes
0answers
39 views

Three-way Repeated Measures ANOVA [closed]

I've posted this question (along with example code and output) at http://www.reddit.com/r/rstats/comments/tglt8/threeway_repeated_measures_anova/ Is this a valid ANOVA model, and are sphericity tests ...
-1
votes
0answers
42 views

Three-way ANOVA interaction effect [closed]

I've posted this question (with example code and output) at http://www.reddit.com/r/rstats/comments/td0fl/threeway_anova_interactions/ For a post-hoc of these significant effects, along with the ...
1
vote
0answers
16 views

Convert data from long format to wide format with multiple measure columns [migrated]

I am having trouble figuring out the most elegant and flexible way to switch data from long format to wide format when I have more than one measure variable I want to bring along. For example, here's ...
1
vote
1answer
54 views

Regression with ARIMA(0,0,0) errors different from linear regression

A Regression with ARIMA errors is given by the following formula (saw on Hyndman et al, 1998): $Y_t = b_0 + b_1 X_{1,t} + \dots + b_k X_{k,t} + N_t$ where $N_t$ is modeled as an ARIMA process. If ...
0
votes
0answers
6 views

Output All Edges of iGraph in R to XML [migrated]

I'm wanting to output all edges in a iGraph g to an XML file, which looks something like this: <edges> <edge from="1" to "2" /> <edge from="1" to "4" /> ... ...
0
votes
0answers
32 views

How do I do group wise clustering in R?

How do I do group wise clustering in R? Hi all, I have N x K data matrix, where N is the number of observations, K is the number of variables. The N observations fall into M categories or groups. ...
0
votes
0answers
38 views

PCA prcomp function of R [closed]

Possible Duplicate: PCA on Correlation or Covariance? I recently used R for some analysis, and encountered the options offered with PCA. The details can be found here: ...
0
votes
0answers
69 views

How to do rank prediction using R?

I'd like to do rank prediction (something very similar with regression) based on historical data, is there any package I can use in R ? Here's my problems: I have a historical data of sports games, ...
10
votes
2answers
227 views

What are good data visualization techniques to compare distributions?

I am writing my PhD thesis and I've realized that I rely excessively in box plots in order to compare distributions. Which other alternatives do you like for achieving this task? I'd also like to ask ...
4
votes
1answer
69 views

How to conduct a factor analysis on questionnaire data?

I have a questionnaire with 30 questions divided into 3 blocks of 10 questions each. Each question is answered with a number 1-10 and then an average of them all is calculated. I need to know how much ...
0
votes
0answers
14 views

Help writing function in R that will select categorical fields from data set [migrated]

I need help writing function that takes three categorical inputs and returns a vector of summary statistics based on these inputs. The data set contains information on retail goods that can be ...
1
vote
1answer
41 views

Post stratification weights in survey package in R

I have data collected from a survey administered on a subset of the population. I also have the population proportions of variables such as gender, race and housing type. I would like to combine the ...
0
votes
2answers
50 views

Improve SVM performance on data with missing features and outliers in R

I'm trying to learn R for ML purposes, and right now i'm building classifier for my data (10 dimensions, ~400 elements, 2 classes), which have some outliers in it, and a lot of missing values. I'm ...
1
vote
0answers
37 views

Multivariate non-parametric density estimation with many missing values

Apologies in advance if any of my terminology here is wrong, I'm not an expert in statistics. If I've made any mistakes, let me know and I'll correct them. The task I'm looking for some advice on ...
0
votes
1answer
42 views

Plotting Options in R: Setting Axis Limits

I am plotting a density estimate for misclassification rate of some classifier using the standard plot and lines functions. Even though I've set xlim=c(0.32,0.38) and ylim=c(0,100) within the plot ...
0
votes
1answer
36 views

Software for fitting generalized least squares model with errors that follow Seasonal ARMA model

I need to fit a GLS model, with some known regressors, and where the errors follow an unknown ARIMA(1,0,1)x(1,N,1) model. It seems like the main tool out there for such models is the gls function in ...
1
vote
1answer
48 views

How to utilize the result of aov function?

Based on the responses from the question How to draw a side-by-side plot mentioned in "Graphical Display as an Aid to Analysis", I am considering implementing the function myself. The ...
1
vote
1answer
51 views

Fisher Test in R

Suppose we have the following data set: Men Women Dieting 10 30 Non-dieting 5 60 If I run the Fisher exact test in R then what does alternative = ...
0
votes
1answer
37 views

Minimum number of observations to determine long range dependency

What is the minimum number of observations to be considered in order to determine long range dependency? I'm trying to estimate Hurst parameter using R/S method. I've used SELFIS as well as R. ...
0
votes
0answers
30 views

R error when using predict() function with class = fGarch [migrated]

Sorry if this is a repost, but I searched and couldn't find anything similar I'm using the fGarch package to fit arma(2,0)+garch(1,0), then taking the fit and running predict() on it to produce ...
1
vote
1answer
29 views

Calculating Expected Value of a Streak

What is the expected length of a streak of heads or tails when flipping a coin? What distribution is this? I'm pretty sure the answer is 2. But I don't know what distributions it is.. I did the ...
1
vote
0answers
35 views

What does rnorm in R return when the sd argument contains a vector? [migrated]

What does the following code do: rnorm(10, mean=2, sd=1:10) The first number is from N(2,1) The second number if from N(2,2) The third number is from N(2,3) etc...?
3
votes
1answer
59 views

Simulating values from an estimated value and confidence interval in R

I am using the estimated county-level poverty measure from the Small Area Income and Poverty Estimates (SAIPE) as the dependent variable in a regression analysis. This value is itself the result of a ...
0
votes
1answer
54 views

Plot with 2 conditions on the y axis

First, I want to clarify this is a very basic question. I'm new using R (and programming in general). I have a data.frame with 3 columns: block, average condition 1, average condition 2. The ...
0
votes
0answers
7 views

Produce indicator values + variance explained tables of a MRT produced by mvpart (R)

How can I produce ta table with the variance explained by each explain variable and a table with indicator values of the explain variables of the MRT produced by mvpart (R) Example? --> table 2 and ...
1
vote
2answers
88 views

R package for visualizing and exploring large datasets

I recently read about a package, which I believe had a name like "tabstat" or "tablestats" which produced a really useful plot of univariate distributions of multiple variables for large datasets. I ...
1
vote
1answer
62 views

Relation between two ordinal variables

For a university course, a friend of mine had to test whether there is a relation between two ordinal variables. These variables were opinion about the European Union (positive, neutral, negative) and ...
0
votes
1answer
109 views

How to draw a side-by-side plot mentioned in “Graphical Display as an Aid to Analysis”

Emerson, J. D. (1991) Graphical Display as an Aid to Analysis, in Fundamentals of Exploratory Analysis of Variance (eds D. C. Hoaglin, F. Mosteller and J. W. Tukey), John Wiley & Sons, Inc., ...
0
votes
0answers
17 views

Is hypergeometric test phyper(x, m, n, k) still suitable when m comprises two parts

Suppose there is an urn with 2183 white balls, 1093 red balls and 2393 black balls,if I consider the white balls and red balls as interesting balls(m=2183+1093=3276 in hypergeometric test in phyper(x, ...
0
votes
1answer
52 views

How does the mice imputation function work?

I was wondering if anyone had experience using the mice function, as described in mice: Multivariate Imputation by Chained Equations in R (JSS 2011 45(3))? I have a dataset with a number of variables, ...
4
votes
1answer
69 views

Randomly generated adjacency matrix in R

I'm wanting to generate random connected directed acyclic graphs, and am wondering if there is a way of populating an adjacency matrix in R which would represent the aforementioned. Something similar ...
-1
votes
0answers
131 views

Regression in R

I am a simple student who is having troubles with an analysis in R program. I have a database of 93 variables. I have created a few subsets (10) by inserting different numbers of variables in each ...

1 2 3 4 5 39