[R] Multiple imputation with plausible values already in the data

2007-07-17 Thread Ulrich Keller
Hello, this is not really an R-related question, but since the posting guide does not forbid asking non-R questions (even encourages it to some degree), I though I'd give it a try. I am currently doing some secondary analyses of the PISA (http://pisa.oecd.org) student data. I would like to treat

[R] gsub: replacing a.*a if no occurence of b in .*

2007-02-24 Thread Ulrich Keller
I am trying to read a number of XML files using xmlTreeParse(). Unfortunately, some of them are malformed in a way that makes R crash. The problem is that closing tags are sometimes repeated like this: tagvalue1/tagtagvalue2/tagsome garbage/tag/tagtagvalue3/tag I want to preprocess the contents

[R] options(digits) and print.default()

2007-01-15 Thread Ulrich Keller
Hello everyone, I use latex() (Hmisc) for report generation and thus have been affected by the problem with rounding decimals described, for example, in this post: http://thread.gmane.org/gmane.comp.lang.r.general/73287/focus=73287 In short, numbers often are printed with 15 or so decimals even

[R] Evaluation of defaults in functions

2006-09-28 Thread Ulrich Keller
Hello, and sorry if this is already explained somewhere. I couldn't find anything. R (2.3.1, Windows) seems to perform some kind of lazy evaluation when evaluating defaults in function calls that, at least for me, leads to unexpected results. Consider the following, seemingly equivalent

Re: [R] From 2.2.1 to 2.3

2006-08-03 Thread Ulrich Keller
http://cran.r-project.org/bin/windows/base/rw-FAQ.html#What_0027s-the-best-way-to-upgrade_003f [EMAIL PROTECTED] wrote: Hello everyone. Currently I am running R 2.2.1 (windows), and I will like to update to 2.3. I wanted to ask if it is possible to update without having to removed 2.2.1;

Re: [R] read.spss 'error reading system-file header'

2006-08-01 Thread Ulrich Keller
Question 2: Try saving the data as an SPSS portable file. I never had trouble reading these in R. Finn Sandø wrote: When I try to import an spss sav file with read.spss() I am getting the following error 'Error in read.spss(X:\\.sav) : error reading system-file header' and the import

Re: [R] na.rm problem

2006-08-01 Thread Ulrich Keller
Like the error message tells you, cor does not have an argument na.rm. use=complete already does what you want, namely casewise deletion of missing values. However, this will not work with vectors of unequal length (how is R to determine which observations in x correspond to those in y?). What

Re: [R] Test for equality of coefficients in multivariate multiple regression

2006-07-19 Thread Ulrich Keller
Hello and thank you for your answers, Andrew and Berwin. If I'm not mistaken, the mixed-model version of Berwin's approach would be: #My stuff: DF-data.frame(x1=rep(c(0,1),each=50),x2=rep(c(0,1),50)) tmp-rnorm(100) DF$y1-tmp+DF$x1*.5+DF$x2*.3+rnorm(100,0,.5)

[R] Test for equality of coefficients in multivariate multiple regression

2006-07-18 Thread Ulrich Keller
Hello, suppose I have a multivariate multiple regression model such as the following: DF-data.frame(x1=rep(c(0,1),each=50),x2=rep(c(0,1),50)) tmp-rnorm(100) DF$y1-tmp+DF$x1*.5+DF$x2*.3+rnorm(100,0,.5) DF$y2-tmp+DF$x1*.5+DF$x2*.7+rnorm(100,0,.5) x.mlm-lm(cbind(y1,y2)~x1+x2,data=DF)

Re: [R] Edit function

2006-06-07 Thread Ulrich Keller
fix(data) will invoke edit(data) and store changes you make in data without displaying anything. stat stat schrieb: Dear all R users, I have a query on Edit function. Suppose I have a data frame named data. I can use EDIT function to see the materials contained in data, by using

Re: [R] bootstrap data from groups

2006-06-07 Thread Ulrich Keller
I am not sure I understand what you want to do, but maybe some of this will be helpful. I first generate some data that should resemble yours: dat-expand.grid(Region=1:3, Species=1:4, Sex=c(M,F)) dat-do.call(rbind,lapply(1:10,function(x) dat)) dat$Bodysize-rnorm(nrow(dat),10,2) Now what the

[R] Two problems with write.foreign (SPSS)

2006-05-29 Thread Ulrich Keller
Hello, Working on a little primer to ease the transition from SPSS to R, I have encountered two problems with write.foreign. One is cosmetic (but still annoying): the text data files will contain NA for missing values. Each time SPSS encounters an NA, it will print a warning. This could be

Re: [R] bVar slot of lmer objects and standard errors

2006-03-02 Thread Ulrich Keller
Vielen Dank, Spencer. I could not find a published example where both the original data and conditional posterior variances were available. Instead, I toyed around a little with artificial data, and the (pretty pathetic) result below is the closest I came to Monte Carlo-ing. I'm afraid I lack

Re: [R] bVar slot of lmer objects and standard errors

2006-02-20 Thread Ulrich Keller
Hello, I'm sorry to resurrect this thread that I started almost two months ago. I've been pretty busy since I posted my question and the issue is not that high on my priority list. Thanks to all those who replied, and I hope I can tickle your interest again. As a reminder, my question was how

[R] bVar slot of lmer objects and standard errors

2005-12-22 Thread Ulrich Keller
Hello, I am looking for a way to obtain standard errors for emprirical Bayes estimates of a model fitted with lmer (like the ones plotted on page 14 of the document available at http://www.eric.ed.gov/ERICDocs/data/ericdocs2/content_storage_01/000b/80/2b/b3/94.pdf). Harold Doran mentioned