[R] How to pass a model formula as argument to with.mids

2010-09-23 Thread Erich Studerus
Hello I would like to pass a model formula as an argument to the with.mids function from the mice package. The with.mids functon fits models to multiply imputed data sets. Here's a simple example library(mice) #Create multiple imputations on the nhanes data contained in the mice package.

[R] Solved: Input encoding problem when using sweave with xetex

2010-05-13 Thread Erich Studerus
With the kind help of Duncan Murdoch, I finally managed to correctly compile LyX-Sweave documents with XeTeX under Windows. In case someone else is struggling with a similar problem in the future, here is a small summary of what worked for me. I assume that you have already set up Lyx to work

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
Thanks again. It finally worked after copying the Sweave.sh file to a path that contains no spaces. Is there a special command for windows specific path names with spaces? Erich On Wed, 12 May 2010 18:04:44 -0400 Duncan Murdoch wrote: On 12/05/2010 5:12 PM, Erich Studerus wrote: You were

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
e directory. Then you can change the Lyx preference line to \converter "literate" "latex""R CMD UTF8Sweave $$i" "" and things should work. (Then you can restore the original Sweave.sh file for cases where you don't want UTF-8.) Duncan Murdoch

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
n 12/05/2010 2:29 PM, Erich Studerus wrote: Thank you! I edited the Sweave.sh file and it works now for reading data stored as R data files, but the read.xls function from the gdata-package does no longer work. options('encoding'='UTF-8') require(gdata) read.xls("http://www

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
p.ch/hoergeraete_test.xls";, stringsAsFactors = F)[2,2] This gives NA as output and a warning that there was an invalid entry for the connection. Is there a way to use read.xls with UTF-8 encoding? On Wed, 12 May 2010 12:45:51 -0400 Duncan Murdoch wrote: On 12/05/2010 11:36 AM, Erich Studerus wrot

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
roject.org/contrib/extra/lyx/preferences Regards, Erich -Ursprüngliche Nachricht- Von: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Gesendet: Mittwoch, 12. Mai 2010 16:56 An: Erich Studerus Cc: r-help@r-project.org Betreff: Re: [R] Input encoding problem when using sweave with xetex On

Re: [R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
ailto:murdoch.dun...@gmail.com] Gesendet: Mittwoch, 12. Mai 2010 15:27 An: Erich Studerus Cc: r-help@r-project.org Betreff: Re: [R] Input encoding problem when using sweave with xetex On 12/05/2010 8:37 AM, Erich Studerus wrote: > Hello > > > > Because I want to use different true

[R] Input encoding problem when using sweave with xetex

2010-05-12 Thread Erich Studerus
Hello Because I want to use different true type fonts with latex, I'm using the XeTeX typesetting engine for my sweave-documents. I'm using Lyx with Sweave on a Windows 7 PC and have set up LyX to work with XeTeX according to the following instructions: http://wiki.lyx.org/LyX/XeTeX Becau

[R] barchart in lattice 0.18-5

2010-04-24 Thread Erich Studerus
Hello After updating to R version 2.11.0, the xlim argument of the lattice barchart function does no longer work as expected. For example, the following code does not produce the same result in lattice lattice_0.18-3 and lattice_0.18-5 barchart(t(matrix(1:3,1:3)),horizontal=F,box.width=1,xli

[R] storing initial path for tkgetOpenFile

2009-10-25 Thread Erich Studerus
Hi, I'd like to store the path from which I opened a file with tkgetOpenFile and use it as the initial path for the next function call of tkgetOpenFile. What is the best way of doing this? The following works fine on my Windows computer. However, I'm not sure if it works on other platforms.

Re: [R] Excel Export in a beauty way

2009-06-06 Thread Erich Studerus, Psychiatrische Uni-Klinik
Hi, Here's a function to export dataframes to an excel-file with the RDCOMClient package. It makes bold headers and fits the column widths automatically. If more than one dataframe is provided to the function, the dataframes are saved to seperate spreadheets within file. export.xls <- functi

Re: [R] Adjusting confidence intervals for paired t-tests of multiple endpoints

2009-03-02 Thread Erich Studerus
ready-made range of comparisons; you can also set up your own. Regards, Mark. Erich Studerus wrote: > > Johannes Huesing wrote: >> Couldn't you re-phrase your model by including timepoint as a continuous >> regressor and scale as a factor? > > Well, the measuri

Re: [R] Adjusting confidence intervals for paired t-tests of multiple endpoints

2009-03-01 Thread Erich Studerus, Psychiatrische Uni-Klinik
Johannes Huesing wrote: Couldn't you re-phrase your model by including timepoint as a continuous regressor and scale as a factor? Well, the measuring time points are 70 170, 300 and 1440 minutes after drug intake. Since the influence of time is cerainly not linear, I think it's better to tr

Re: [R] Adjusting confidence intervals for paired t-tests of multiple endpoints

2009-02-28 Thread Erich Studerus, Psychiatrische Uni-Klinik
Thanks, but as far as I know the multcomp package and the tukeyHSD function can only handle one dependent variable, whereas I have 60 dependent variables. Regards, Erich On Sat, 28 Feb 2009 17:41:11 + (UTC) Dieter Menne wrote: Erich Studerus bli.uzh.ch> writes: Dear R-users,

[R] Adjusting confidence intervals for paired t-tests of multiple endpoints

2009-02-27 Thread Erich Studerus
Dear R-users, In a randomized placebo-controlled within-subject design, subjects recieved a psycho-active drug and placebo. Subjects filled out a questionnaire containing 15 scales on four different time points after drug administration. In order to detect drug effects on each time point, I

[R] Two-way repeated measures anova with lme

2009-01-12 Thread Erich Studerus
Dear R-Users, I'm trying to set up a repeated measures anova with two within subjects factors. I tried it by 3 different anova functions: aov, Anova (from car package) and lme (from nlme package). I managed to get the same results with aov and Anova, but the results that I get from lme are slig

[R] Problems with impute function from Hmisc library

2009-01-12 Thread Erich Studerus
Hello I would like to use the transcan and impute functions from Hmisc library for single impution. library(Hmisc) m1<-data.frame(x1=rnorm(20),x2=rnorm(20),x3=rnorm(20)) m1[c(2,4),1]<-NA t1<-transcan(~x1+x2+x3,data=m1,imputed=T) impute(t1) Fehler in as.environment(pos) : kein Ein

[R] diagonal lines in legends of ggplot2

2008-12-19 Thread Erich Studerus
Hi, I have the following problem with ggplot2: When I specify black contours for bars in a barplot, ggplot automatically shows diagonal lines in the legend boxes. Is there a way, to remove these diagonal lines? Here's a simple example: library(ggplot2) df<-data.frame(x=gl(6,1),y=rnorm(6,10

[R] Several problems with hmisc latex function

2008-10-18 Thread Erich Studerus, Psychiatrische Uni-Klinik
Hi, I'm having several problems with the Hmisc latex function. First, there seems to be a conflict between the cellTexCmds and the cgroupTexComds. When I'm using both at the same time, I get an error message. Here's an example. I just added cellTexComds to the example on page 10 of this docume

Re: [R] NA's in multiple choice summary table in Hmisc

2008-10-09 Thread Erich Studerus
rich -Ursprüngliche Nachricht- Von: Frank E Harrell Jr [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 9. Oktober 2008 04:17 An: Erich Studerus, Psychiatrische Uni-Klinik Cc: r-help@r-project.org Betreff: Re: [R] NA's in multiple choice summary table in Hmisc Erich Studerus, Psychiatri

[R] NA's in multiple choice summary table in Hmisc

2008-10-08 Thread Erich Studerus, Psychiatrische Uni-Klinik
Hi, I have a set of 30 binary variables measuring side effects after drug treatment. Since each subject can have multiple side effects, I want to display these side effects in a multiple choice table. I'm using the summary and mChoice functions of the Hmisc package, because it produces nicely

Re: [R] getting line breaks with xtable

2008-09-19 Thread Erich Studerus
OTECTED] Gesendet: Freitag, 19. September 2008 15:50 An: Erich Studerus Cc: r-help@r-project.org Betreff: Re: [R] getting line breaks with xtable Read the last line to every message to r-help to find out one reason you may be getting no responses. On Fri, Sep 19, 2008 at 9:39 AM, Erich Studerus

[R] getting line breaks with xtable

2008-09-19 Thread Erich Studerus
Sorry, for asking the same question again, but I got no reactions the last time. Maybe it was just overseen by the experts. I'm using the xtable function with Sweave and Lyx and I would like to know how to get automatic line breaks for long strings in a column of the table. I've learned from the Ly

[R] How to get line breaks with xtable

2008-09-16 Thread Erich Studerus
Hi, I'm using the xtable function with Sweave and Lyx. The table that I'd like to display has very long string characters in one column. Is there a way to get automatic line breaks for the strings in that column with xtable? Thanks for your help! Erich _

Re: [R] plotting group means

2008-09-09 Thread Erich Studerus
functions, which can do that or is there an easy way to rearrange the columns into one? Thanks Erich -Ursprüngliche Nachricht- Von: hadley wickham [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 9. September 2008 15:02 An: ONKELINX, Thierry Cc: Erich Studerus; r-help@r-project.org Betreff: Re

[R] plotting group means

2008-09-09 Thread Erich Studerus
R, which can do the same? Erich ____ Erich Studerus Lic. Phil. Klinische Psychologie Psychiatric University Hospital Zurich Division of Clinical Research Lenggstr. 31 CH-8008 Zurich Switzerland Mail: [EMAIL PROTECTED] Office: +41 44 384 26 66

Re: [R] How to preserve date format while aggregating

2008-09-08 Thread Erich Studerus
dataframes. Erich -Ursprüngliche Nachricht- Von: Dr Eberhard Lisse [mailto:[EMAIL PROTECTED] Gesendet: Montag, 8. September 2008 15:43 An: Erich Studerus Cc: r-help@r-project.org Betreff: Re: [R] How to preserve date format while aggregating Erich, how does the data look, when it comes f

Re: [R] How to preserve date format while aggregating

2008-09-08 Thread Erich Studerus
re elegant way to extract the rows with minimum/earliest date per subject. Erich -Ursprüngliche Nachricht- Von: jim holtman [mailto:[EMAIL PROTECTED] Gesendet: Montag, 8. September 2008 14:24 An: Erich Studerus Cc: r-help@r-project.org Betreff: Re: [R] How to preserve date form

[R] How to preserve date format while aggregating

2008-09-08 Thread Erich Studerus
Hi I have a dataframe in which some subjects appear in more than one row. I want to extract the subject-rows which have the minimum date per subject. I tried the following aggregate function. attach(dataframe.xy) aggregate(Date,list(SubjectID),min) Unfortunately, the format of the Date-column c