[R] sample() from (un-)sorted vectors

2012-08-15 Thread saschaview
Hello, Vector y is an alphabetically sorted version of vector x. Will both samples, X and Y, be "absolutely" random or will they have systematic differences? And: Should I sort or shuffle a vector before sampling? Thank you, *S* x <- as.factor(LETTERS[sequence(10:1)]) y <- sort(x) X <- sampl

Re: [R] Non-parametric test for repeated measures and post-hoc single comparisons in R?

2012-02-20 Thread saschaview
Thanks, I got it! (And I think I should have googled what "replicated" means!) However, then Bortz, Lienert, Boehnke are imprecise, if not wrong: "Der Friedman-Test setzt voraus, dass die N Individuen wechselseitig unabhängig sind, dass also nicht etwa ein und dasselbe Individuum zweimal oder m

Re: [R] Non-parametric test for repeated measures and post-hoc single comparisons in R?

2012-02-19 Thread saschaview
On 19.02.12 19:31, Tal Galili wrote: The following post would not answer your question at full, but might give some good code/information: http://www.r-statistics.com/2010/02/post-hoc-analysis-for-friedmans-test-r-code/ Thank you, Tal! As you already mentioned, your interesting post supports

[R] Non-parametric test for repeated measures and post-hoc single comparisons in R?

2012-02-19 Thread saschaview
Some attribute x from 17 individuals was recorded repeatedly on 6 time points using a Likert scale with 7 distractors. Which statistical test(s) can I apply to check whether the changes along the 6 time points were significant? set.seed( 123 ) x <- matrix( sample( 1:7, 17*6, repl=T ), nrow =

[R] transform data.frame holding answers --> data.frame holding logicals

2011-12-01 Thread saschaview
Hello Hello I have a data frame, x, holding 5 persons answering the question which cars they have used: # the data frame x <- as.data.frame( matrix( c('BMW', '', '', 'Mercedes', 'VW', '', 'Skoda', 'VW', 'BMW', '', '', '', 'VW', 'Skoda', '' ), ncol=3,

[R] md.pattern ('mice') failure with more than 31 variables

2011-11-29 Thread saschaview
Hello How come that the function md.pattern() from package 'mice' delivers a warning when run over data sets with more than 31 variables? library( 'mice' ) x <- as.data.frame( matrix( sample( c(1:3, 1:3, 1:3, NA), 7000, repl=TRUE ), ncol=35, dimnames=list(NULL, paste('V', 1

[R] Apply functions along "layers" of a data matrix

2011-11-18 Thread saschaview
Hello How can I apply functions along "layers" of a data matrix? Example: daf <- data.frame( 'id' = rep(1:5, 3), matrix(1:60, nrow=15, dimnames=list( NULL, paste('v', 1:4, sep='') )), rep = rep(1:3, each=5) ) The data frame "daf" contains 3 repetitions/layers (rep) of 4 variables of 5 p