Re: [R] Strange degrees of freedom and SS from car::Anova with type II SS?

2018-12-05 Thread Fox, John
Dear R., The problem you constructed is too ill-conditioned for the method that Anova() uses to compute type-II sums of squares and the associated degrees of freedom, with an immense condition number of the coefficient covariance matrix: > library(car) Loading required package: carData > mod <

[R] Strange degrees of freedom and SS from car::Anova with type II SS?

2018-12-05 Thread Ramon Diaz-Uriarte
Dear All, I do not understand the degrees of freedom returned by car::Anova under some models. They seem to be too many (e.g., numerical variables getting more than 1 df, factors getting more df than levels there are). This is a reproducible example: library(car) data(Prestige) ## Make sure n

[R] Simple-Effects Test for Unbalanced Mixed ANOVA

2018-12-05 Thread Cory C
Hello everyone. I am working on an Open Stats Lab (https://sites.trinity.edu/osl/) activity for factorial ANOVA and have posted my analysis on GitHub (link below). Once I have a significant interaction, how do I conduct a simple-effects test in R? The mixed design is unbalanced as follows: 1. w

Re: [R] sustraction of two vectors of matrix

2018-12-05 Thread Jeff Newmiller
or with no loops and no preallocation: bb <- aa[ , 2:5 ] - aa[ , 1:4 ] On December 5, 2018 8:51:16 AM PST, Rui Barradas wrote: >Hello, > >1) You don't need matrix(outer(etc)), outer already returns a matrix. >2) You need to create bb first. > >aa <- outer(0:3, 0:4, function(x,y) x + y*2) > >bb

Re: [R] sustraction of two vectors of matrix

2018-12-05 Thread Rui Barradas
Hello, 1) You don't need matrix(outer(etc)), outer already returns a matrix. 2) You need to create bb first. aa <- outer(0:3, 0:4, function(x,y) x + y*2) bb <- matrix(nrow = 4, ncol = 4) for(i in 1:4){ for(j in 2:5){ bb[i, j - 1] <- aa[i, j] - aa[i, j - 1] } } bb Hope this helps, R

[R] sustraction of two vectors of matrix

2018-12-05 Thread malika yassa via R-help
helloplease   I want to make a sustration of two vectors of a matrix i have this program aa<-matrix(outer(0:3,0:4,function(x,y) x+y*2),nrow=4,ncol=5) for(i in 1:4) + {for(j in 2:5) + {bb[i,j-1]=aa[i,j]-aa[i,j-1] + } + } at the end i obtain the bb=matrix( nrow=4,ncol=4) but i cann't obtain this mat

Re: [R] Random projection

2018-12-05 Thread Jan Galkowski
Ms Fleming, This blog post (of mine) may be of interest and hopefully of help: https://667-per-cm.net/2018/11/20/the-johnson-lindenstrauss-lemma-and-the-paradoxical-power-of-random-linear-operators-part-1/ Cheers! -- Jan Galkowski (o°) Westwood, MA (pronouns: *he, him, his*) *Keep your energy