[R] Imputing Missing Data: A Good Starting Point?

2011-11-01 Thread Sascha Vieweg
program that provides some future, and of course I want some background on what I am doing (and what not). Could you help with some hints, experiences, and recommendations? Thank you. Regards *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r

[R] Include C++ DLL, error in ...: C symbol name not in load table

2011-04-20 Thread Sascha Vieweg
C) 4.2.1 (Apple Inc. build 5666) (dot 3) platform i386-apple-darwin9.8.0 arch i386 os darwin9.8.0 system i386, darwin9.8.0 status major 2 minor 12.2 year 2011 month 02 day25 svn rev54585 language R

[R] S: expert mailing list for general statistical questions

2011-04-20 Thread Sascha Vieweg
on a mailing list or newsgroup appropriate for such issues? Thanks for your tips. Regards, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] cube root

2011-04-17 Thread Sascha Vieweg
, can anybody explain this?! (Why is x[1]^(1/3)=y[1]=NaN, but -8^(1/3)=-2?) -8^(1/3) == (-8)^(1/3) # NA -8^(1/3) == -(8^(1/3)) # TRUE Thx!!! You're welcome. -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list

Re: [R] Rotating the x-axis labels of a barplot

2011-04-16 Thread Sascha Vieweg
ere I'm stuck: How do I move the x-axis labels to the _center_ of each bar? Right now, they line up with the right-side of each bar. Try to set the parameter: adj=.5 (see ?par). HTH, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.o

Re: [R] glm with multiple vars

2011-04-09 Thread Sascha Vieweg
it into a formula object, since glm expects a formula object: vars <- names(x) f <- as.formula(paste(vars[1], "~", paste(vars[-1], collapse="+"), collapse="")) glm(f, data=x) Of course, the pastes in the f-line need to be adjusted in e

Re: [R] multinom() residual deviance

2011-04-09 Thread Sascha Vieweg
ce the number of parameters, among other things). The three clases, "a", "b" and "c" remain separate in the model. Hence the two models are not directly comparable, so why should the deviance be? Bill Venables. ________ From: r-help-bou

[R] multinom() residual deviance

2011-04-08 Thread Sascha Vieweg
ces to calculate some of the pseudo R-squares with function pR2(), package "pscl".) Could you give good advice? Thanks *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] code for "permutative" operation

2011-03-14 Thread Sascha Vieweg
On 11-03-14 21:09, David Winsemius wrote: On Mar 14, 2011, at 3:52 PM, Sascha Vieweg wrote: Hello, I need some form of a "permutative" operation on a numeric vector x x = (v1, v2, v3, ..., vN) that produces x.r = (v1, v1+2, v1+v2+v3, ... v1+v2+...+vN) If the operation is sum()

[R] code for "permutative" operation

2011-03-14 Thread Sascha Vieweg
ocedure applied to the vector? Specifically, the zeros in the matrix may cause problems with other operations than sum. Thanks, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] plotCI() with ggplot2

2011-03-08 Thread Sascha Vieweg
s=NA) text(1:length(m1[, 1]), -.2, c("v1", "v2"), cex=1, xpd=T, adj=.5, srt=0) abline(h=seq(0, 7, 1), col=gray(.7), lty="dotted", lwd=.85) legend(1.9, 7.1, legend=c(".7", ".5"), title="Condition:", cex=.8 ) I like to produce this plot

[R] S. function calculating x +- y

2011-03-04 Thread Sascha Vieweg
Hello, I am looking for an elegant one-liner for the following operation: x <- rnorm(10) y <- runif(10) c(mean(x)-mean(y), mean(x)+mean(y)) I thought about apply(data.frame(x, y), 2, mean) but I don't know how to apply the +- operation on the result of apply. Thanks, *S* -- Sa

Re: [R] create a data frame with the given column names

2011-02-17 Thread Sascha Vieweg
code. Then you could start here: vstr <- sample(letters, sample(1:20, 1), repl=F) df <- as.data.frame(matrix(ncol=length(vstr), dimnames=list(NULL, vstr))) str(df) HTH, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailin

Re: [R] From numeric vector to string vector

2011-02-13 Thread Sascha Vieweg
quot;) ?sprintf Just for my own understanding: Why not as.character(Vect) ? -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] From SPSS Syntax to R code

2011-02-13 Thread Sascha Vieweg
R", "Li", "M", "La")) # making the "as.nimeric(stubstr(...))" convenient atsub2 <- as.numeric(substr(ATVK, 2, 3)) atsub4 <- as.numeric(substr(ATVK, 4, 5)) atsub6 <- as.numeric(substr(ATVK, 6, 7)) # didn't find a one-liner, however, this shou

Re: [R] p-value for y in non-parametric distribution, Y

2011-02-08 Thread Sascha Vieweg
On 11-02-07 19:21, Sascha Vieweg wrote: Hello, knowing that some index y, with y(341)=2, SE=3, is t-distributed, I (think I) can find an appropriate (left/one-sided) p-value with R: y <- 2 R: yse <- 3 R: (p <- 1-pt(y/yse, df=341)) Now, some simulation resulted in the non-p

[R] p-value for y in non-parametric distribution, Y

2011-02-07 Thread Sascha Vieweg
<- rnorm(21277) How can I find the p-value of y then? Simply counting? Thanks, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R

[R] boot() versus loop, and statistics option

2011-02-06 Thread Sascha Vieweg
dvantages of 'boot()' over my loop? (3) Can I in principle use 'boot()' to return all of the 100 different data vectors used in the loop, or does 'boot()' by default return already-calculated statistics? Thanks for hints and help, *S* -- Sascha Vieweg, saschav..

[R] Create factorial design

2011-02-05 Thread Sascha Vieweg
ought about R: x <- numeric(n) R: for(i in 1:7){ x[df[, "area"]==i] <- ass[ ass[, "area"]==i , "strategy"] } and then binding the new variable to the data frame R: str(df2 <- as.data.frame(cbind(df, "strategy"=x))) which works f

[R] Sweave: change tab size

2011-01-31 Thread Sascha Vieweg
ation did not provide a cue. Thanks for hints, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.htm

Re: [R] R-/Text-editor for Windows?

2011-01-31 Thread Sascha Vieweg
On 11-01-28 19:55, Sascha Vieweg wrote: [...] Besides Emacs and the R built-in editor, could you recommend a good editor for Windows, even some commmercial for a small price? Thanks for all your answers and experiences. You helped a lot. *S

[R] R-/Text-editor for Windows?

2011-01-28 Thread Sascha Vieweg
built-in editor, could you recommend a good editor for Windows, even some commmercial for a small price? (For a comparison, TextMate for OS X is 35 USD and does a great job on all plain text and code related issues, not only R.) Thanks, *S* -- Sascha Vieweg, saschav...@gmail.com

Re: [R] read ODS (OOorg spreadsheet) files?

2011-01-28 Thread Sascha Vieweg
On 11-01-28 17:37, Sascha Vieweg wrote: I am wondering if there's any news about reading ODS files directly. ODS files are the spreadsheet files produced by OpenOffice.org. Currently, I export sheets in these files to csv files, one for each sheet. However, it would be much more convenie

[R] read ODS (OOorg spreadsheet) files?

2011-01-28 Thread Sascha Vieweg
s and updates, *S* -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal,

Re: [R] creating categorical frequency tables from continuous data

2011-01-27 Thread Sascha Vieweg
please? Thanks in advance! Louise __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. --

Re: [R] Writing program for these

2011-01-27 Thread Sascha Vieweg
q[1] & z good luck, Ben Bolker __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] Help needed

2011-01-27 Thread Sascha Vieweg
On 11-01-27 15:12, Sascha Vieweg wrote: On 11-01-27 13:16, Ben Boyadjian wrote: Hello I am trying to solve these problems and I am not allowed to use loops or ifs. 1st Question My first question is that I have generated 100 random numbers from the uniform distribution then A)add only

Re: [R] Help needed

2011-01-27 Thread Sascha Vieweg
h/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing l

Re: [R] predict() for bootstrapped model coefficients

2011-01-22 Thread Sascha Vieweg
On 11-01-20 17:05, Sascha Vieweg wrote: I run a multinomial regression on a data set with an outcome that has three values. First, I build an initial model, b.mod. Then I run a loop to bootstrap the coefficients. For the initial model, using "predict()", I can print the w

Re: [R] which operating system + computer specifications lead to the best performance for R?

2011-01-22 Thread Sascha Vieweg
environment (things like passing shell commands from R to my system or other interpreters), easy graphics etc. If that helps a bit ... -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] Accessing MySQL Database in R

2011-01-21 Thread Sascha Vieweg
these aren't equivalent? > -- > View this message in context: > http://r.789695.n4.nabble.com/Accessing-MySQL-Database-in-R-tp3221264p3221264.html > Sent from the R help mailing list archive at Nabble.com __ R-help@r-project.org ma

[R] predict() for bootstrapped model coefficients

2011-01-20 Thread Sascha Vieweg
place=T) m <- update(b.mod, . ~ ., data=df[l, ], trace=F) c.mat.1[i, ] <- coef(m)[1, ] c.mat.2[i, ] <- coef(m)[2, ] i <- i + 1 } (coefs1 <- apply(c.mat.1, 2, mean)) (coefs2 <- apply(c.mat.2, 2, mean)) summary(predict(b.mod)==model.frame(b.mod)$y) -- Sascha Vieweg, sascha

Re: [R] Statistical formulas

2011-01-18 Thread Sascha Vieweg
n the field of psychology one recommendation is (still) also: Hays, W. L. (1994). Statistics. Belmont, CA: Wadsworth. Depending on your German skills (if at all) THE Bortz could be a good textbook, Bortz, J. (2005). Statistik für Human- und Sozialwissenschaftler (6. Aufl). Berlin: Springer. Goo

[R] t-test calculation correct?

2011-01-17 Thread Sascha Vieweg
s where this calculation is wrong and why. Ref.: Bortz, J. (2005). Statistik für Human- und Sozialwissenschaftler (6. Aufl). Berlin: Springer. -- Sascha Vieweg, saschav...@gmail.com __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

Re: [R] unicode&pdf font problem RESOLVED

2011-01-13 Thread Sascha Vieweg
.pdf") plot(1,type="n") text(1,1,"print ü") dev.off() Your default screen fonts may not be the same as your default pdf fonts. A lot depends on system specifics, none of which have you provided. I found an earlier post at http://www.mail-archive.com/r-help@r-project.org