Re: [R] e1071::skewness and psych::skew return NaN

2013-02-13 Thread Stephen Politzer-Ahles
Hi everyone, Please disregard my last message, I found a 0 in the vector, which is what was causing problems with the log and reciprocal data. Best, Steve On Wed, Feb 13, 2013 at 10:55 AM, Stephen Politzer-Ahles wrote: > Hello everyone, > > Does anyone know what would cause the

[R] e1071::skewness and psych::skew return NaN

2013-02-13 Thread Stephen Politzer-Ahles
- 1/data ) ) #returns NaN The vector has no missing values (and if it did, I would get NA rather than NaN, and the function wouldn't return a number when I give it the raw data). Best, Steve -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://peopl

Re: [R] Fitting a multinomial model to a multi-way factorial design with repeated measures: help on package and syntax

2012-12-06 Thread Stephen Politzer-Ahles
ven't tried them myself. Best, Steve -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://people.ku.edu/~sjpa/ __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide ht

Re: [R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
guide asked for 'at a minimum' information: if you are using an > unreleased development version of R you really must tell us (and should not > be reporting to the R-help list). > > >> >> Sarah >> >> On Wed, Dec 5, 2012 at 3:53 PM, Stephen Politzer-Ahles &

Re: [R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
rle(). What are you > trying to accomplish? > > Sarah > > On Wed, Dec 5, 2012 at 3:53 PM, Stephen Politzer-Ahles > wrote: >> Hello, >> >> duplicated() does not seem to work for a long vector. For example, if >> you download the data from >> https:/

[R] duplicated() with long vectors

2012-12-05 Thread Stephen Politzer-Ahles
y I've figured out to get this duplicated()-like vector is to use a for loop going through one item at a time, but that takes about a minute to run. Best, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://people.ku.edu/~sjpa/

Re: [R] Using multcomp::glht() with Anova object

2012-12-05 Thread Stephen Politzer-Ahles
Thank you John, I'll take a look at that! Best, Steve On Wed, Dec 5, 2012 at 11:39 AM, John Fox wrote: > > Dear Steve, > > Usually the best place to look for information about functions in the car > package, along with the help files for the package, is the book with which > the package is asso

[R] Using multcomp::glht() with Anova object

2012-12-05 Thread Stephen Politzer-Ahles
ng the anova using aov() or lme(), since I don't need the Huynh-Feldt corrections in the post-hoc tests...but I am just curious if i can do the post-hocs directly on my Anova object.) Best, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://pe

Re: [R] Adding a new variable to each element of a list

2012-11-26 Thread Stephen Politzer-Ahles
which BTW gets removed by individually inserting > as you showed. > > A.K. > > > > > > > > > From: Stephen Politzer-Ahles > To: arun > Cc: R help > Sent: Sunday, November 25, 2012 8:35 PM > Subject: Re: [R] Adding a new variable to each element of a li

Re: [R] Adding a new variable to each element of a list

2012-11-25 Thread Stephen Politzer-Ahles
7.467 13.58 0.002683 0.5 0.7724 > #Residuals 8 4.40 0.550 0.5 0.7724#Here it got > repeated > > May be there are better methods > > A.K. > > > > > > - Original Message - > From: Stephen Politzer-Ahles > To: r-help@r-project.org &g

[R] Adding a new variable to each element of a list

2012-11-24 Thread Stephen Politzer-Ahles
[1:2] 13.6 NA .. ..$ Pr(>F) : num [1:2] 0.00268 NA *.. ..$ Thing : num **0.772413* ..- attr(*, "class")= chr [1:2] "summary.aov" "listof" Now, I know how to do this if I want to just add the variable to one element at a time: result[[1]][[1]]$Thing <- 0.

Re: [R] Merging multiple columns into one column

2012-09-30 Thread Stephen Politzer-Ahles
Hi Meredith, Why not just use paste()? cuyahoga_nf$newcolumn <- paste(cuyahoga_nf[,1], cuyahoga_nf[,2], cuyahoga_nf[,3], . , cuyahoga_nf[,4]) Best, Steve Politzer_ahles - Original Message - > From: Meredith Ballard LaBeau > To: r-help@r-project.org > Cc: > Sent: Friday, September

Re: [R] Count based on 2 conditions [Beginner Question]

2012-09-17 Thread Stephen Politzer-Ahles
Most of your counting needs can be handled elegantly with the xtabs() function (cross-tabulation). This'll work a lot faster than an iterative method. For your data I would suggest something like this: # Create a column indicating whether or not the value in Col2 is above 5 dataset$Col2greaterthan

Re: [R] create new variable with ifelse? (reproducible example)

2012-09-16 Thread Stephen Politzer-Ahles
Hi Niklas, I like A.K.'s method. Here's another way to do what I think is the same thing you're asking for (this is how I did it before I knew ifelse() existed!) rep_data$clo <- 0 rep_data[ rep_data$know %in% c("very well", "fairly well") & rep_data$getalong %in% c(4,5),]$clo <- 1 Best, Steve -

Re: [R] R-help Digest, Vol 115, Issue 12

2012-09-12 Thread Stephen Politzer-Ahles
Hello Amelie, I don't have an answer to your question, but I just wanted to point out this page I noticed recently ( http://hlplab.wordpress.com/2009/05/07/multinomial-random-effects-models-in-r/), which might be helpful. I'm also interested in figuring out how to do a multinomial glmm, so if you

[R] Contrasts in mixed effects model: difference between differences

2012-09-12 Thread Stephen Politzer-Ahles
etween coefficients (my understanding is that the standard error of the coefficients I would get from ranef(test)$Subject is not going to be exactly the same as the standard error reported for the fixed effect [Baayen, 2008:247]). Thank you very much for your feedback, Steve Politzer-Ahles --

[R] Contrasts in mixed effects model: difference between differences

2012-09-12 Thread Stephen Politzer-Ahles
ly the same as the standard error reported for the fixed effect [Baayen, 2008:247]). Thank you very much for your feedback, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://www.linguistics.ku.edu/ [[alternative HT

[R] Contrasts for 2x4 interaction in mixed effects model

2012-09-11 Thread Stephen Politzer-Ahles
Hi Rachel, Do you get what you need with lmer(H.y.~(cond/patient)*stance + (1|subj), data=H) ? That should give you the comparison between patient groups at each level of Condition (the cond1:patient1, cond2:patient2, and cond2:patient3 that you were looking for). (And I guess it will also give

Re: [R] Contrasts for 2x4 interaction in mixed effects model

2012-09-08 Thread Stephen Politzer-Ahles
me(y=rnorm(16), > Sec=rep(LETTERS[1:4], each=4), > Fir=rep(factor(1:2), 4, each=2)) > contrasts(tmp$Fir) <- c(1, -1) > tmp.aov <- aov(y ~ Sec/Fir, data=tmp) > anova(tmp.aov) > cbind(tmp, model.matrix(tmp.aov)[, -1]) > > > On Fri, Se

[R] Contrasts for 2x4 interaction in mixed effects model

2012-09-07 Thread Stephen Politzer-Ahles
cients I get for the interaction terms do the comparisons I'm interested in? Thank you for your advice, Steve Politzer-Ahles -- Stephen Politzer-Ahles University of Kansas Linguistics Department http://www.linguistics.ku.edu/ [[alternative HTML version deleted]] __