[R] R: specifying a function in nls

2008-10-11 Thread Joseph Kambeitz
I am encoutering s similar problem to the one described before in "specifying a function in nls". I defined a function "plot_it2" in the following way: plot_it2<-function(SOA,t1weight, t2weight, d1weight, d2weight){ sapply(SOA,plot_it,t1weight, t2weight, d1weight, d2weight) } fit shoul

Re: [R] step() and stepAIC()

2008-10-11 Thread Prof Brian Ripley
On Sun, 12 Oct 2008, Murray Jorgensen wrote: The birth weight example from ?stepAIC in package MASS runs well as indeed it should. However when I change stepAIC() calls to step() calls I get warning messages that I don't understand, although the output is similar. Why would you do this? War

Re: [R] svm models in a loop

2008-10-11 Thread Alexy Khrabrov
On Oct 12, 2008, at 2:26 AM, Prof Brian Ripley wrote: You need to use substitute() on the call. Something like sapply(1:5,function(i) eval(substitute(svm(person_oid ~ ., data=zrr[1:N,]), list(N=100*i)) ) Thanks! On Sun, 12 Oct 2008, Alexy Khrabrov wrote: I want to train sv

Re: [R] svm models in a loop

2008-10-11 Thread Prof Brian Ripley
You need to use substitute() on the call. Something like sapply(1:5,function(i) eval(substitute(svm(person_oid ~ ., data=zrr[1:N,]), list(N=100*i)) ) On Sun, 12 Oct 2008, Alexy Khrabrov wrote: I want to train svm models on increasingly large training data subsets of some zrr as f

Re: [R] subsetting dataframe by rownames to be excluded

2008-10-11 Thread Prof Brian Ripley
On Sat, 11 Oct 2008, Alexy Khrabrov wrote: Is there a way to select a subset of a dataframe consisting of all those rows with rownames *except* from a subset of rownames to be excluded? Example: Yes: DF[is.na(match(row.names(DF), exclude_me)), ] a <- data.frame(x=1:10,y=10:1) a <- a[order

Re: [R] singular information matrix in lrm.fit

2008-10-11 Thread Prof Brian Ripley
I believe lrm has a criterion appropriate to single-precision calculations (as S-PLUS used to use). Try reducing 'tol' from its default of 1e-7. But your design matrix *is* near singular kappa(cbind(1,x)) [1] 557390.5 so try centring/scaling your variables. On Sun, 12 Oct 2008, Gad Abraham

Re: [R] Creating GUIs for R

2008-10-11 Thread Graham Williams
Received Fri 10 Oct 2008 5:21am +1100 from Greg Snow: > I am not involved in the RExcel project. I have just had some > discussions with the people that are, so you should contact them for > specific questions. I believe that this currently only works on > windows, there was some mention of pos

[R] svm models in a loop

2008-10-11 Thread Alexy Khrabrov
I want to train svm models on increasingly large training data subsets of some zrr as follows: > m <- sapply(1:5,function(i) svm(person_oid~.,data=zrr[1:100*i,]))# (*) However, when I inspect m[1], it literally shows > m[1] [[1]] svm(formula = person_oid ~ ., data = zrr[1:N, ]) -- as

[R] subsetting dataframe by rownames to be excluded

2008-10-11 Thread Alexy Khrabrov
Is there a way to select a subset of a dataframe consisting of all those rows with rownames *except* from a subset of rownames to be excluded? Example: > a <- data.frame(x=1:10,y=10:1) > a <- a[order(a$y),] # to make rownames differ visually > a[8,] x y 3 3 8 > a["8",] x y 8 8 3 > a[-

Re: [R] Sweave-LaTEX question

2008-10-11 Thread cls59
Felipe Carrillo wrote: > > > Does LATEX have to be installed on your computer? > > Yes, the LaTeX package contains compilers necessary for transforming LaTeX mark-up and macros into beautifully typeset documents. Making use of Sweave requires a LaTeX distribution to be present on your machi

[R] singular information matrix in lrm.fit

2008-10-11 Thread Gad Abraham
Hi, I'm trying to do binary logistic regression on 10 covariables, comparing glm to lrm from Harrell's Design package. They don't seem to agree on whether the data is collinear: > library(Design) > load(url("http://www.csse.unimelb.edu.au/~gabraham/data.Rdata";)) > lrm(y ~ X1 + X2 + X3 + X4 +

[R] step() and stepAIC()

2008-10-11 Thread Murray Jorgensen
The birth weight example from ?stepAIC in package MASS runs well as indeed it should. However when I change stepAIC() calls to step() calls I get warning messages that I don't understand, although the output is similar. Warning messages: 1: In model.response(m, "numeric") : using type="numeric

[R] [R-pkgs] New package: expert 1.0-0

2008-10-11 Thread Mathieu Pigeon
expert: Modeling Without Data Using Expert Opinion Expert opinion is a technique to do statistical modeling when data is scarse (e.g. accidents in nuclear plants) or even absent, at least for the analyst (e.g. confidential settlements in liability insurance). Opinions on the distribution of the d

[R] [R-pkgs] New package: bit 1.0

2008-10-11 Thread Jens Oehlschlägel
Dear R community, Package 'bit' Version 1.0 is available on CRAN. It provides bitmapped vectors of booleans (no NAs), coercion from and to logicals, integers and integer subscripts; fast boolean operators and fast summary statistics. With bit vectors you can store true binary booleans {FALSE,

[R] [R-pkgs] New verision 0.95 of package 'memisc' released to CRAN

2008-10-11 Thread Martin Elff
Dear useRs, I am pleased to announce the availability of version 0.95 of package 'memisc' on CRAN (http://cran.r-project.org/web/packages/memisc/). 'memisc' does not implement any new estimators, but focuses on providing an infrastructure for data analysis especially of survey data. It may be o

[R] [R-pkgs] hwriter - Writing R objects in HTML format

2008-10-11 Thread Gregoire Pau
Dear R community, I'm pleased to announce the availability of hwriter v0.93 on CRAN. hwriter is an easy-to-use package able to format and output R objects in HTML format. It supports advanced formatting, tables, CSS styling, images and provides a convenient mapping between R tables and HTML tabl

[R] Sweave-LaTEX question

2008-10-11 Thread Felipe Carrillo
Hi: I am working on a publication and I have heard about LaTEX but I haven't actually tried to learn about it until today. I've found a few examples but I can't actually make them work properly. I have a couple of questions: Does LATEX have to be installed on your computer? How does the xtable pa

Re: [R] Copyright Symbol

2008-10-11 Thread Prof Brian Ripley
What OS, what graphics device, what locale, what version of R? (As asked for in the posting guide.) In many cases you can just use "\uA9" as part of text to be plotted. There is two copyright symbols in Adobe Symbol, so you can probably use symbol("\323") and symbol("\343") in plotmath if you

Re: [R] Copyright Symbol

2008-10-11 Thread hadley wickham
Well, modulo your R set up, you should just be able to copy and paste that symbol into a text string: copy <- "(c)" and then place it wherever you like with text() or mtext(). Hadley On Sat, Oct 11, 2008 at 4:54 PM, Dr Eberhard W Lisse <[EMAIL PROTECTED]> wrote: > How do I put a copyright symbo

[R] Copyright Symbol

2008-10-11 Thread Dr Eberhard W Lisse
How do I put a copyright symbol (C) (or ©) into a plot? title/sub or legend. And/or somewhere to the bottom right of the image. greetings, el __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R vs SPSS contrasts

2008-10-11 Thread Gabor Grothendieck
Don't know but perhaps you could just use each of: contr.helmert, contr.poly, contr.sum, contr.treatment, contr.SAS in turn on the R side until you get one that matches. Once you find out adding a contr.SPSS to R might be nice. On Sat, Oct 11, 2008 at 3:31 PM, Ted Harding <[EMAIL PROTECTED]> wrot

Re: [R] Extracting subset of a vector

2008-10-11 Thread jim holtman
Work with the indices. > x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) > x1 <- sample(length(x), 5, replace=FALSE) > x1 [1] 18 20 12 11 1 > length(x.new)> x[x1] # selected [1] 88 88 92 88 100 > x.new <- x[-x1] # remove sampled values > x.new [1] 96 88 100 100 96

Re: [R] Extracting subset of a vector

2008-10-11 Thread Jorge Ivan Velez
Hi Megh, You're right. It happens because the replications of some elements of your vector x are "removed" once you put the condition. So, when you type table(x) and table(x1), you'll have something like this: # x # 68 72 80 84 88 92 96 100 # 2 2 1 2 5 2 3 3 # x1 # 88 92 96 #

Re: [R] Extracting subset of a vector

2008-10-11 Thread Peter Dalgaard
Megh Dal wrote: Thanks for this suggestion. However I am not getting : length(x) = length(x1) + length(x[ ! x %in% x1]) Any better idea? If you don't like the answer, you need to rephrase the question (what "remains" when you remove a value that occurs multiple times in x?) x[-match(x

Re: [R] Extracting subset of a vector

2008-10-11 Thread Megh Dal
Thanks for this suggestion. However I am not getting : length(x) = length(x1) + length(x[ ! x %in% x1]) Any better idea? --- On Sun, 10/12/08, Jorge Ivan Velez <[EMAIL PROTECTED]> wrote: > From: Jorge Ivan Velez <[EMAIL PROTECTED]> > Subject: Re: [R] Extracting subset of a vector > To: [EMAIL

Re: [R] Extracting subset of a vector

2008-10-11 Thread Peter Dalgaard
Megh Dal wrote: I have 2 vecros : x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector "x" those are not member of vector "x1". Can anyone please tell me how to do that? x[!(x %in% x1)] should do

Re: [R] Extracting subset of a vector

2008-10-11 Thread Jorge Ivan Velez
Hi Megh, Try this: x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) x[ ! x %in% x1] HTH, Jorge On Sat, Oct 11, 2008 at 3:25 PM, Megh Dal <[EMAIL PROTECTED]> wrote: > I have 2 vecros : > x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,

Re: [R] Extracting subset of a vector

2008-10-11 Thread Daniel Malter
Hi Megh, two options: x=1:20 y=1:10 z1=x[x%in%y==FALSE] z2=x[x!=y] z1 z2 Cheers, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Megh Dal Gesendet: Saturda

[R] R vs SPSS contrasts

2008-10-11 Thread Ted Harding
Hi Folks, I'm comparing some output from R with output from SPSS. The coefficients of the independent variables (which are all factors, each at 2 levels) are identical. However, R's Intercept (using default contr.treatment) differs from SPSS's 'constant'. It seems that the contrasts were set in S

[R] Extracting subset of a vector

2008-10-11 Thread Megh Dal
I have 2 vecros : x<-c(100,96,88,100,100,96,80,68,92,96,88,92,68,84,84,88,72,88,72,88) x1 = sample(x, 5, replace=FALSE) Now i want to get remaining values of vector "x" those are not member of vector "x1". Can anyone please tell me how to do that? __ R

[R] [R-pkgs] release of RcmdrPlugin.Export 0.2-1

2008-10-11 Thread Liviu Andronic
Dear R users, A new version of RcmdrPlugin.Export is currently available on CRAN. The release introduces support for the "file" and "append" options of print.xtable(). The new features make easier to include exported HTML code into documents created with regular word-processing programmes, such as

[R] [R-pkgs] MiscPsycho 1.3 posted to CRAN

2008-10-11 Thread Doran, Harold
An updated version of the Miscellaneous Psychometrics package has been updated to CRAN. The following updates are included in the package: 1) An implementation of the Stocking-Lord procedure for linking test scales. 2) An implementation of the Levenshtein algorithm for comparing character strings

Re: [R] BRugs removed?

2008-10-11 Thread Uwe Ligges
Haoda Fu wrote: All - I am new to this help list. Please forgive me if this question has been asked before. A couple of questions about running BRugs in R. 1. I found that it has been removed from R package list. Why is it removed? Is there any improved package to replace BRugs? It ha

[R] BRugs removed?

2008-10-11 Thread Haoda Fu
All - I am new to this help list. Please forgive me if this question has been asked before. A couple of questions about running BRugs in R. 1. I found that it has been removed from R package list. Why is it removed? Is there any improved package to replace BRugs? 2.I run BRugs and sometimes

Re: [R] producing colour .eps output

2008-10-11 Thread Prof Brian Ripley
I don't see anywhere you asked for colour, and postscript() is regarded as a 'print device' so the default is monochrome. See ?trellis.device and the discussion of themes there: AFAICS you want to set a colour theme. On Sat, 11 Oct 2008, RICHARD PITMAN wrote: I am using the following code t

[R] producing colour .eps output

2008-10-11 Thread RICHARD PITMAN
I am using the following code to produce a graphic: library(lattice) postscript("figs%03d.eps", width = 6.0, height = 6.0,    horizontal = FALSE, onefile = FALSE, paper = "special") xyplot(cases~yr|agrp*sex,data=data[tse==0 & expgrp==1,], groups=source, pch=".", type="l",    mai

Re: [R] graphics

2008-10-11 Thread hadley wickham
On Sat, Oct 11, 2008 at 3:06 AM, Darja Poklukar <[EMAIL PROTECTED]> wrote: > > I just want to ask how to enlarge the resolution of my plots in R. For ex. > for publising I would like a picture of resolution minimal 500 dpi, all I > managed was picture of dim 5,28 X 5,83 with 118 pixels/cm. What

[R] Running anova on different datasets

2008-10-11 Thread Himanshu Ardawatia
Hi, I have to run several one way anova in R and analyze results from them. My questions are : 1. Where do we we specify alpha value while running anova in R ? I ran one set and the results just showed F-value, P-value apart from other data... Of course we can always compare the output P-value w

Re: [R] plotCI

2008-10-11 Thread Manuel Morales
On Fri, 2008-10-10 at 18:15 -0300, Caio Azevedo wrote: > Hi all, > > I am using the function "plotCI" with the following command: > > plotCI(m.residuos.p.2 [1:41],li=m.residuos.p.3 [1:41],ui=m.residuos.p.4 > [1:41],lty=1,ylab="") > > This generates exactly what I want except for the fact that I

[R] graphics

2008-10-11 Thread Darja Poklukar
I just want to ask how to enlarge the resolution of my plots in R. For ex. for publising I would like a picture of resolution minimal 500 dpi, all I managed was picture of dim 5,28 X 5,83 with 118 pixels/cm. Thank You for the answer! With best regards, Darja Rupnik [[alternative HTML v

Re: [R] plotCI

2008-10-11 Thread Jim Lemon
Caio Azevedo wrote: Hi all, I am using the function "plotCI" with the following command: plotCI(m.residuos.p.2 [1:41],li=m.residuos.p.3 [1:41],ui=m.residuos.p.4 [1:41],lty=1,ylab="") This generates exactly what I want except for the fact that I wanna drawn a line linking the points (m.residuos

Re: [R] predicting from a local regression and plotting in lattice

2008-10-11 Thread Dieter Menne
Alex Karner ucdavis.edu> writes: > I'm trying to (1) plot loess lines for each of my groupings using the same > color for each group; (2) plot loess predicted values. > > The first part is easy: .. Example removed... Thanks, it was a good example of what you wanted! > My question is, how do I

[R] Re : AW: Coefficients in a polynomial glm with family poisson/binomial

2008-10-11 Thread sam_oi
Thanks for that Daniel, Problem solved. I was mis-specifying the equation, omitting that I had to account for the logit transformation used in family binomial. i.e. had to write y~exp(b+ax+cx^2)/(1+exp(b+ax+cx^2)) to make use of the coeffs The last part of what I was doing worked, running an lm

Re: [R] interpreting Shapiro-Wilks test result

2008-10-11 Thread Bernardo Rangel Tura
Em Qua, 2008-10-08 às 17:41 -0700, Halizah Basiron escreveu: > Hi all, >I am newbie in using R software and also doing statistical test. I want to > know if my data in in normal distribution. I have 2 groups of data and I did > calculate Shapiro Wilks using R software. Here is the results: >

Re: [R] plotCI

2008-10-11 Thread baptiste auguie
Hi it might be as simple as adding type = "b" in your call, however if you need more help you'll have to provide a reproducible example and explain what package you used (I think several packages define a plotCI function). Hope this helps, Baptiste On 10 Oct 2008, at 22:15, Caio Azeved