Re: [R] create list of vectors in for loop

2016-12-06 Thread Paul Sanfilippo
i in n){ list_of_vecs[[i]]<-rnorm(10,0,1) } If you really want to use "assign": for (i in n){ vecname<-paste('vec_', i, sep = '') assign(vecname, rnorm(10,0,1)) list_of_vecs[[i]]<-get(vecname) } Jim On Tue, Dec 6, 2016 at 8:44 PM,

[R] create list of vectors in for loop

2016-12-06 Thread Paul Sanfilippo
Hi, As an exercise, I am trying to create a list of 10 random number vectors in a loop. I can create the vectors but am unsure how to assemble them in the list as part of the loop. Any advice? # Number of vectors to create n <- c(1:10) # Create empty list to store vectors list_of_vecs <- list

Re: [R] Multivariable Wald to test equality of multinomial coefficients

2016-10-03 Thread Paul Sanfilippo
Thank you very much Peter - very enlightening to do it from first principles! Regards, Paul On 4 October 2016 at 10:23:52 am, peter dalgaard (pda...@gmail.com) wrote: > On 04 Oct 2016, at 00:30 , Paul Sanfilippo wrote: > > Hi, > > I am trying to replicate a tes

Re: [R] Multivariable Wald to test equality of multinomial coefficients

2016-10-03 Thread Paul Sanfilippo
the coefficients are sufficiently dissimilar. Regards, Paul Sanfilippo  On 4 October 2016 at 10:08:12 am, Bert Gunter (bgunter.4...@gmail.com) wrote: See inline. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things in

[R] Multivariable Wald to test equality of multinomial coefficients

2016-10-03 Thread Paul Sanfilippo
Hi, I am trying to replicate a test in the Hosmer - Applied Logistic regression text (pp 289, 3rd ed) that uses a Multivariable Wald test to test the equality of coefficients across the 2 logits of a 3 category response multinomial model. I’d like to see whether (from a  statistical standpoint)

[R] ggplot grouped barchart based on marginal proportions

2016-09-26 Thread Paul Sanfilippo
I am trying to create a grouped barplot that uses marginal (row) proportions rather than cell proportions and can't figure out how to change: y = (..count..)/sum(..count..) in ggplot to do this. Using the mtcars dataset as an example and considering two categorical variables (cyl and am - purel