Re: [R] how to use the EV AND condEV from BMA's results?

2006-08-09 Thread Spencer Graves
zhijie zhang wrote: > Dear friends, > In R, the help of "bic.glm" tells the difference between postmean(the > posterior mean of each coefficient from model averaging) and > condpostmean(the posterior mean of each coefficient conditional on the > variable being included in the model), But it's sti

Re: [R] decimal accuracy in pnorm( )

2006-08-09 Thread Prof Brian Ripley
On Thu, 10 Aug 2006, Chronopoulos Dimitris wrote: > Dear R users > > Is there any way to increase the decimal accuracy for the normal > probability distribution? When one needs an accurate p-value for > instance this is provided by > > pnorm(10,lower.tail=F) > [1] 7.619853e-24 > > However, wh

Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread Prof Brian Ripley
On Wed, 9 Aug 2006, Am Stat wrote: > Dr. Ripley, R-help is not the address of `Dr. Ripley', nor even that of the person who wrote to you. > Thanks very much for your help. I have used your partition tree and it works > well. I am not familiar with the 'tree' package but I found that the > th

Re: [R] Error message when using optim

2006-08-09 Thread Prof Brian Ripley
(Subject changed to something less perjorative. This is not `optim error'.) On Wed, 9 Aug 2006, Frank Black wrote: > Dear all, > > There have been one or two questions posted to the list regarding the optim > error "non-finite finite-difference value [4]." The error apparently means > that

[R] OT UNIX grep question

2006-08-09 Thread Erin Hodgess
Dear R People: I want to use the "grep" command in UNIX/Linux to check some words from the dictionary. Let's say I use: grep dog /usr/share/dict/words and I get back bulldog dog dogged and so on. How could I just get back "dog" with the grep command please? Thanks, Sincerely Erin Hodgess As

Re: [R] index.cond in xyplot

2006-08-09 Thread Deepayan Sarkar
On 8/9/06, Taka Matzmoto <[EMAIL PROTECTED]> wrote: > Dear R-users > > I have 5 dependent variables (y1 to y5) and one independent variable (x) and > 3 conditioning variables (m, n, and 0). Each of the conditioning variables > has 2 levels. I created 2*4 panel plots. > > xyplot(y1+y2+y3+y4+y5 ~ x

[R] R2HTML incomplete echo

2006-08-09 Thread Michael Kubovy
Dear R-helpers, When I run > HTMLStart(outdir = outDir, echo = TRUE, HTMLframe = TRUE, + filename = 'jdHW1', Title = 'John Doe HW 2') *** Output redirected to directory: /Users/mk/Documents/teach/ 2006.3.PSYC712 *** Use HTMLStop() to end redirection.[1] TRUE HTML> as.title("This is my first

Re: [R] index.cond in xyplot

2006-08-09 Thread Gabor Grothendieck
That's not a valid specification. See the description of the index.cond argument in ?xyplot and in particular this part: If 'index.cond' is a list, it has to be as long as the number of conditioning variables, and the 'i'-th component has to be a valid

[R] index.cond in xyplot

2006-08-09 Thread Taka Matzmoto
Dear R-users I have 5 dependent variables (y1 to y5) and one independent variable (x) and 3 conditioning variables (m, n, and 0). Each of the conditioning variables has 2 levels. I created 2*4 panel plots. xyplot(y1+y2+y3+y4+y5 ~ x | m*n*o,layout = c(4,2)) I would like to reorder the 8 panels

[R] Your email requires verification verify#QTaQ31oVh73RQhN8fgCXtoSQaCqGXMTf

2006-08-09 Thread verify
The message you sent requires that you verify that you are a real live human being and not a spam source. To complete this verification, simply reply to this message and leave the subject line intact. The headers of the message sent from your address are show below: >From r-help@stat.math.ethz.

Re: [R] minimization a quadratic form with some coef fixed and some constrained

2006-08-09 Thread Berwin A Turlach
> "YX" == Yingfu Xie <[EMAIL PROTECTED]> writes: YX> Thanks for reply! But I think that solution is right without YX> the constrain b'b=1. With this constrain, the solution is not YX> so simple. :( But simple enough. :) Write down the Lagrange function for the problem. Say, 'lam'

[R] Capabilities and JGR

2006-08-09 Thread Michael Kubovy
Dear R-helpers, Using the Mac OS X GUI, > capabilities() jpeg pngtcltk X11 http/ftp sockets libxml fifo clediticonv NLS TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE Under JGR > capabilities() jp

[R] how to link matrix with the variables

2006-08-09 Thread zhijie zhang
Dear friends, Suppose the correlation matrix of x1-x3 is as follows: x1 x2 x3 x1 1 x2 0.51 x3 0.6 0.41 1.First, to generate the matrix of x1-x3 in R; 2.to get the random number: x1<-rnorm(10), is it enough to generate only the x1-values? Do i need to generate x2 and x3? 3

[R] graphic output file format

2006-08-09 Thread Conan Phelan
I would like to save graphics I produce in jpeg or gif formats. The GDD package sounds like it should let me to do this, but I cannot get it to install (error: Can't find gd.h!). Anyone know what's up? Thnx, C __ R-help@stat.math.ethz.ch mailing list h

[R] Is there a better way than x[1:length(x)-1] ?

2006-08-09 Thread John McHenry
Hi WizaRds, In MATLAB you can do x=1:10 and then specify x(2:end) to get 2 3 4 5 6 7 8 9 10 or whatever (note that in MATLAB the parenthetic index notation is used, not brackets as in R). The point is that 'end' allows you to refer to the final index point of the array. Obviously there i

Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread hadley wickham
> Could you please tell me how to draw the decision boundaries in a scatterplot > of the original data for a LDA or Rpart object. > > For example: > > library(rpart) > >fit.rpart <- rpart(as.factor(group.id)~., data=data.frame(Data) ) > You might want to have a look a classifly (http://had.co.nz/

[R] decimal accuracy in pnorm( )

2006-08-09 Thread Chronopoulos Dimitris
Dear R users Is there any way to increase the decimal accuracy for the normal probability distribution? When one needs an accurate p-value for instance this is provided by pnorm(10,lower.tail=F) [1] 7.619853e-24 However, what happens when instead of a P[X=x] is the objective. Thank you in a

Re: [R] minimization a quadratic form with some coef fixed and some constrained

2006-08-09 Thread Yingfu Xie
Hello, Thanks for reply! But I think that solution is right without the constrain b'b=1. With this constrain, the solution is not so simple. :( Regards, Yingfu Från: Rolf Turner [mailto:[EMAIL PROTECTED] Skickat: on 2006-08-09 18:08 Till: Yingfu Xie; r-help@s

Re: [R] Constrain coefs. in linear model to sum to 0

2006-08-09 Thread Gregor Gorjanc
Hello, [EMAIL PROTECTED] wrote: > > Gorjanc Gregor asks: > >> Hello! >> >> I would like to use constrain to sum coeficients of a factor to 0 > instead >> of classical corner contraint i.e. I would like to fit a model like >> >> lm(y ~ 1 + effectA + effectB) >> >> and say get parameters >> >> in

Re: [R] parameter yaxs / function hist (graphics)

2006-08-09 Thread Paulo Barata
Mr. Schwartz, Thank you very much for the proper solution. Regards, Paulo Barata (Rio de Janeiro, Brasil) Marc Schwartz (via MN) wrote: > Paulo, > > Try the following: > > x <- rnorm(100) > > par(xaxs = "i") > par(yaxs = "i")

Re: [R] How to draw the decision boundaries for LDA and Rpart object

2006-08-09 Thread Am Stat
Dr. Ripley, Thanks very much for your help. I have used your partition tree and it works well. I am not familiar with the 'tree' package but I found that the threshold to make a cut returned by tree and rpart is almost the same value. Does that mean the decision boundaries for Rpart and Tree

Re: [R] Linear Trend in Residiuals From lme

2006-08-09 Thread Douglas Bates
On 8/9/06, Rick Bilonick <[EMAIL PROTECTED]> wrote: > On Wed, 2006-08-09 at 15:04 -0500, Douglas Bates wrote: > > On 8/9/06, Rick Bilonick <[EMAIL PROTECTED]> wrote: > > > I'm fitting a mixed effects model: > > > > > > fit.1 <- lme(y~x,random=~1|id,data=df) > > > > > > There are two different obser

Re: [R] tk combobox question

2006-08-09 Thread JeeBee
I think you want something like this: require(tcltk) || stop("Package tcltk is not available.") version.BWidget <- tclvalue(tclRequire("BWidget")) modify_command <- function() { print("Hey, I'm modified...") } tt <- tktoplevel() values = c("foo", "bar", "jeebee") combo <- tkw

Re: [R] R CMD check and RUnit

2006-08-09 Thread Gorjanc Gregor
I have created page [1] in R Wiki on this topic. http://wiki.r-project.org/rwiki/doku.php?id=developers:runit Seth, I have also managed to tweak doRUnit.R so that R CMD check gives an error if the tests fail. I will leave windows port for someone else ;) "Gorjanc Gregor" <[EMAIL PROTECTED]> wri

Re: [R] Linear Trend in Residiuals From lme

2006-08-09 Thread Rick Bilonick
On Wed, 2006-08-09 at 15:04 -0500, Douglas Bates wrote: > On 8/9/06, Rick Bilonick <[EMAIL PROTECTED]> wrote: > > I'm fitting a mixed effects model: > > > > fit.1 <- lme(y~x,random=~1|id,data=df) > > > > There are two different observations for each id for both x and y. When > > I use plot(fit.1),

Re: [R] Speeding indexing and sub-sectioning of 3d array

2006-08-09 Thread Patrick Burns
First off, I hope that the function you list is just an example since it only returns what the last iteration does -- obviously the same answer can be arrived at much quicker. The main principal in speeding up loops is to do as little inside the loops as possible. 'fjj1' is essentially the same a

Re: [R] Linear Trend in Residiuals From lme

2006-08-09 Thread Rick Bilonick
On Wed, 2006-08-09 at 15:04 -0500, Douglas Bates wrote: > On 8/9/06, Rick Bilonick <[EMAIL PROTECTED]> wrote: > > I'm fitting a mixed effects model: > > > > fit.1 <- lme(y~x,random=~1|id,data=df) > > > > There are two different observations for each id for both x and y. When > > I use plot(fit.1),

[R] optim error

2006-08-09 Thread Frank Black
Dear all, There have been one or two questions posted to the list regarding the optim error "non-finite finite-difference value [4]." The error apparently means that the 4th element of the gradient is non-finite. My question is what part(s) of my program should I fiddle with in an attempt to

Re: [R] Linear Trend in Residiuals From lme

2006-08-09 Thread Douglas Bates
On 8/9/06, Rick Bilonick <[EMAIL PROTECTED]> wrote: > I'm fitting a mixed effects model: > > fit.1 <- lme(y~x,random=~1|id,data=df) > > There are two different observations for each id for both x and y. When > I use plot(fit.1), there is a strong increasing linear trend in the > residuals versus th

Re: [R] R2HTML: request for an extended example

2006-08-09 Thread Tobias Verbeke
Michael Kubovy wrote: > On Aug 9, 2006, at 9:23 AM, Tobias Verbeke wrote: >> Michael Kubovy wrote: >>> Dear R-helpers, >>> >>> If you know of an extended example of the use of R2HTML, in which >>> the various constructs are present in one place, could you please >>> point me to it or send it to

[R] Linear Trend in Residiuals From lme

2006-08-09 Thread Rick Bilonick
I'm fitting a mixed effects model: fit.1 <- lme(y~x,random=~1|id,data=df) There are two different observations for each id for both x and y. When I use plot(fit.1), there is a strong increasing linear trend in the residuals versus the fitted values (with no outliers). This also happens if I use r

[R] Plot with Julian dates.

2006-08-09 Thread C. Park
Dear Sir/Madam: I simply want to draw x-y plot with Julian dates (x) and numbers (y). Please see below for my program. In the older version of R, the plot(jdat, miles) worked without any problem. But, with the new version of R, plot(jdat, miles) does not work any more. So, I added log="" option

[R] Weighted Mean Confidence Interval

2006-08-09 Thread McGehee, Robert
Hello, I'm looking to calculate a 95% confidence interval about my estimate for a sample's weighted mean, where the calculated confidence interval would equal the t-test confidence interval of the sample in the case when all of the weights are equal. My initial thought was to simply implement a mo

Re: [R] categorical data

2006-08-09 Thread Marc Schwartz (via MN)
On Wed, 2006-08-09 at 18:07 +0200, Christian Oswald wrote: > Dear List, > > I neeed a grouped list with two sort of categorical data. I have a data > .frame like this. > yearcat.b c > 1 2006a1 125 212 > 2 2006a2 256 212 > 3 2005a1

Re: [R] Unique rows

2006-08-09 Thread Lanre Okusanya
Thanks! That worked well On 8/9/06, Dimitrios Rizopoulos <[EMAIL PROTECTED]> wrote: > if you want the first row for the unique 'aa' entries, try the following: > > cc[!duplicated(cc$aa), ] > > > I hope it helps. > > Best, > Dimitris > > > Dimitris Rizopoulos > Ph.D. Student > Biostatistical C

Re: [R] Unique rows

2006-08-09 Thread Lanre Okusanya
Thanks. I tried that, however for some reason, it still left some duplicates On 8/9/06, Gary Collins <[EMAIL PROTECTED]> wrote: > try > > > unique(cc) >aa bb > 1 1 56 > 3 2 33 > 5 3 53 > 7 4 20 > 9 5 63 > 11 6 9 > > HTH > > Gary > > On 09/08/06, Lanre Okusanya <[EMAIL PROTECTED]> w

Re: [R] Unique rows

2006-08-09 Thread jim holtman
> cc[!duplicated(cc$bb),] aa bb 1 1 56 3 2 33 5 3 53 7 4 20 9 5 63 11 6 9 > On 8/9/06, Lanre Okusanya <[EMAIL PROTECTED]> wrote: > > hello all, > > I have a dataset where the subjects are duplicated. How do I subset > such that I can get only I row/subject. > > aa<-c(1,1,2,2,3,3,4,

Re: [R] Unique rows

2006-08-09 Thread Dimitrios Rizopoulos
if you want the first row for the unique 'aa' entries, try the following: cc[!duplicated(cc$aa), ] I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel

[R] Unique rows

2006-08-09 Thread Lanre Okusanya
hello all, I have a dataset where the subjects are duplicated. How do I subset such that I can get only I row/subject. aa<-c(1,1,2,2,3,3,4,4,5,5,6,6) bb<-c(56,56,33,33,53,53,20,20,63,63,9,9) cc<-data.frame(aa,bb) I would like to subset df(cc) such that I can get aa bb 1 56 2 33 3 53 4 20 5 63 6

Re: [R] lme4 and lmeSplines

2006-08-09 Thread Douglas Bates
On 8/2/06, Kevin Wright <[EMAIL PROTECTED]> wrote: > I'm trying to use the lmeSplines package together with lme4. > > Below is (1) an example of lmeSplines together with nlme (2) an > attempt to use lmeSplines with lme4 (3) then a comparison of the > random effects from the two different methods. >

Re: [R] R2HTML: request for an extended example

2006-08-09 Thread Michael Kubovy
On Aug 9, 2006, at 9:23 AM, Tobias Verbeke wrote: > Michael Kubovy wrote: >> Dear R-helpers, >> >> If you know of an extended example of the use of R2HTML, in which >> the various constructs are present in one place, could you please >> point me to it or send it to me? >> > There was an artic

Re: [R] numerical differentiation

2006-08-09 Thread Paul Gilbert
nurza m wrote: > Hi list, > How to do numerical differentiation in R. is it using > genD in numDeriv package This depends on why you want the derivatives. The functions in numDeriv use Richardson extrapolation to get fairly accurate numerical derivatives. If you want the derivatives for optimiza

Re: [R] R CMD check error (solved)

2006-08-09 Thread Christian Hennig
Thank you Martin, >Christian> Dear list, R CMD check on my updated package now >Christian> generated the following error: > >Christian> "LaTeX errors when creating DVI version. This >Christian> typically indicates Rd problems." (...) > > Run > R CMD Rd2dvi > > directly on t

Re: [R] Combinations question

2006-08-09 Thread Martin Maechler
> "Jacques" == Jacques VESLOT <[EMAIL PROTECTED]> > on Wed, 09 Aug 2006 17:33:05 +0200 writes: Jacques> library(gtools) Jacques> cb <- function(n,r) t(apply(combinations(n, r), 1, function(x) ifelse(1:n %in% x, 1, 0))) Jacques> cb(6,3) Several months ago, when this came

[R] numerical differentiation

2006-08-09 Thread nurza m
Hi list, How to do numerical differentiation in R. is it using genD in numDeriv package thanks in advance __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/pos

[R] (3) Courses & R/Splus Advanced Programming in New York City ***September 11-12 ***by the R Development Core Tean Guru

2006-08-09 Thread elvis
__ R-help@stat.math.ethz.ch 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] R CMD check error

2006-08-09 Thread Martin Maechler
> "Christian" == Christian Hennig <[EMAIL PROTECTED]> > on Wed, 9 Aug 2006 17:21:18 +0100 (BST) writes: Christian> Dear list, R CMD check on my updated package now Christian> generated the following error: Christian> "LaTeX errors when creating DVI version. This Chris

[R] Can one use correlations (or R^2) as data for an ANOVA?

2006-08-09 Thread Jose Quesada
Dear all, This may seem obvious for some of you, but it got me thinking. Can one use correlations (or R^2) as data for an ANOVA? The case in hand: I have several models fitting the same data (individual fits per subject). The different models fitting the same guy will produce different R^2, I was

Re: [R] objects and environments

2006-08-09 Thread Adrian Dusa
On Wednesday 09 August 2006 19:14, Gabor Grothendieck wrote: > Dmitris has already provided the solution but just throught I would' > mention that your third alternative can be written: > > apply(mymatrix, 1, fun2, bb = bb) > > (assuming fun2 has arguments idx and bb) which is not > nearly so ugly

[R] R CMD check error

2006-08-09 Thread Christian Hennig
Dear list, R CMD check on my updated package now generated the following error: "LaTeX errors when creating DVI version. This typically indicates Rd problems." But the Rd files (and everything else) were checked as "OK" (I removed the problem about which I asked the list some hours ago, but ans

Re: [R] objects and environments

2006-08-09 Thread Gabor Grothendieck
Dmitris has already provided the solution but just throught I would' mention that your third alternative can be written: apply(mymatrix, 1, fun2, bb = bb) (assuming fun2 has arguments idx and bb) which is not nearly so ugly so you might reconsider whether its ok for you to just pass bb. On 8/9/

Re: [R] minimization a quadratic form with some coef fixed and some constrained

2006-08-09 Thread Rolf Turner
Yingfu Xie wrote: > I had problems with an extension to a classic optimization problem. > > The target is to minimize a quadratic form a'Ma with respect to vector > b, where vector a=(b',-1)', i.e., a is the expand of b, and M is a > symmetric matrix (positive definite if needed). One more constr

[R] categorical data

2006-08-09 Thread Christian Oswald
Dear List, I neeed a grouped list with two sort of categorical data. I have a data .frame like this. yearcat.b c 1 2006a1 125 212 2 2006a2 256 212 3 2005a1 14 12 4 2004a3 565 123 5 2004

[R] cannot plot too much (using Mac interface)

2006-08-09 Thread Alessandro Gagliardi
Thanks. And sorry for abusing the word crash. I understand the difference. However, now that you mention it, there is a case where I think R is crashing. I'm not sure if it's R or if it's the Mac OS interface, but if I try to plot something complicated (or a series of complicated things) while

[R] minimization a quadratic form with some coef fixed and some constrained

2006-08-09 Thread Yingfu Xie
Hello, all, I had problems with an extension to a classic optimization problem. The target is to minimize a quadratic form a'Ma with respect to vector b, where vector a=(b',-1)', i.e., a is the expand of b, and M is a symmetric matrix (positive definite if needed). One more constrain on b is b'b=

Re: [R] Combinations question

2006-08-09 Thread Jacques VESLOT
library(gtools) cb <- function(n,r) t(apply(combinations(n, r), 1, function(x) ifelse(1:n %in% x, 1, 0))) cb(6,3) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (

Re: [R] objects and environments

2006-08-09 Thread Adrian Dusa
On Wednesday 09 August 2006 18:31, Dimitris Rizopoulos wrote: > try this: > > fun1 <- function(x) { > environment(fun2) <- environment() > ifelse(somecondition, bb <- "o", bb <- "*") > ## mymatrix is created, then > myresult <- apply(mymatrix, 1, fun2) > } Beautiful :) Thanks very

Re: [R] objects and environments

2006-08-09 Thread Dimitris Rizopoulos
try this: fun1 <- function(x) { environment(fun2) <- environment() ifelse(somecondition, bb <- "o", bb <- "*") ## mymatrix is created, then myresult <- apply(mymatrix, 1, fun2) } I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School

Re: [R] ggplot facet label font size

2006-08-09 Thread Walker, Sam
Thanks for the lattice help Gabor and Deepayan. These snippets work well. I've only been using R a few months and it and the user community have exceeded my expectations. Best Regards, -Sam -Original Message- From: Deepayan Sarkar [mailto:[EMAIL PROTECTED] Sent: Sunday, August 06, 2006

[R] objects and environments

2006-08-09 Thread Adrian Dusa
Dear list, I have two functions created in the same environment, fun1 and fun2. fun2 is called by fun1, but fun2 should use an object which is created in fun1 fun1 <- function(x) { ifelse(somecondition, bb <- "o", bb <- "*") ## mymatrix is created, then myresult <- apply(mymatrix, 1,

[R] Combinations question

2006-08-09 Thread Martin
I need to generate a {0,1} matrix wifht nCr rows and n columns. The rows of the matrix will consist of all possible combinations containing r ones. My clumsy attempt for n = 6 and r = 3 is X <- expand.grid(c(1,0),c(1,0),c(1,0),c(1,0),c(1,0),c(1,0)) Y <- X[rowSums(X)==3,] I can genralize this in

Re: [R] Joint confidence intervals for GLS models?

2006-08-09 Thread Frank E Harrell Jr
Kennedy David wrote: > Dear All, > > I would like to be able to estimate confidence intervals for a linear > combination of coefficients for a GLS model. I am familiar with John > Foxton's helpful paper on Time Series Regression and Generalised Least > Squares (GLS) and have learnt a bit about t

[R] GARCH(1,1) optimization with R

2006-08-09 Thread Patrick Zhang
Hello all, Trying to implement GARCH(1,1) with ASP.NET and VB.NET. It involves optimization of a three-variate function with some constraints. Learned from Wilmott.com that R might be able to do it but have no idea how. Could anyone help me

Re: [R] unbalanced mixed effects models for fully factorial designs

2006-08-09 Thread Spencer Graves
Dear Prof. Logan: Are you familiar with 'lme' in the 'nlme' package? Superlative documentation for the 'nlme' package is Pinheiro and Bates (2000) Mixed effects models in S and S-PLUS (Springer, listed as 'available' in the catalog of your university library). The standard R distrib

[R] tk combobox question

2006-08-09 Thread Franco Mendolia
Hello! The IWigdets::combobox has an option "selectioncommand" to specify a procedure which is called when an item in the combobox is selected. Does ComboBox from Bwidgets have an equal option or is there a simple method to do thi? I haven't found one but i would like to use Bwidgets instead o

Re: [R] [Rcom-l] GARCH(1,1) optimization with R

2006-08-09 Thread Erich Neuwirth
This is not the right list for your question. Question on how to use R and R's libraries should be posted to R-help@stat.math.ethz.ch Patrick Zhang wrote: > Hello all, > > Trying to implement GARCH(1,1) with ASP.NET and > VB.NET. > It involves optimization of

Re: [R] parameter yaxs / function hist (graphics)

2006-08-09 Thread Marc Schwartz (via MN)
Paulo, Try the following: x <- rnorm(100) par(xaxs = "i") par(yaxs = "i") hist(x, breaks = seq(-4, 4, 0.5), ylim = c(0, 40), xlim = c(-4, 4)) box() The problem is that graphics:::plot.histogram() is coded in such a way that the use of 'xaxs' and 'yaxs' are ineffectual, as they are not p

[R] Speeding indexing and sub-sectioning of 3d array

2006-08-09 Thread Swidan, Firas
Hi, I am having a problem with a very slow indexing and sub-sectioning of a 3d array: > dim(arr) [1] 245 175 150 For each point in the array, I am trying to calculate the mean of the values in its surrounding: mean( arr[ (i - radius):(i + radius), (j - radius):(

Re: [R] lme4 and lmeSplines

2006-08-09 Thread Spencer Graves
At least at one time, to use lmer after lme, you had to quit R before loading 'lme4' because of substantive conflicts between 'nlme' and 'lme4' / 'Matrix'. That may be the source of your problem. I can think of two possible ways to get around this: 1. I might try quittin

[R] Rd question: itemize in arguments

2006-08-09 Thread Christian Hennig
Dear list, I'm writing Rd files and I'd like to have a list inside the description of an argument: (...) \arguments{ (...) \item{bootmethod}{vector of strings, defining the methods used for resampling. Possible methods: \itemize{ \item{"boot"} {Nonparametric bootstrap (precis

Re: [R] Sampling from a Matrix

2006-08-09 Thread Marc Schwartz (via MN)
On Tue, 2006-08-08 at 14:10 -0400, Liaw, Andy wrote: > From: Marc Schwartz > > > On Fri, 2006-08-04 at 12:46 -0400, Daniel Gerlanc wrote: > > > Hello all, > > > > > > Consider the following problem: > > > > > > There is a matrix of probabilities: > > > > > > > set.seed(1) > > > > probs <- arra

Re: [R] data.frame to shape

2006-08-09 Thread Gabor Grothendieck
Try this: DF[unlist(tapply(rownames(DF), DF$id, function(x) c(x, x[1]))),] On 8/9/06, Leonardo Lami <[EMAIL PROTECTED]> wrote: > Hi all, > I have a simple question: > I have a data.frame like this: > > id x y > 1 50 1647685 4815259 > 2 50 1647546 4815196 > 3 50 1647454 4815294 >

[R] R: data.frame to shape

2006-08-09 Thread Guazzetti Stefano
assuming that the rows are sorted correctly dat id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50 1647405 4815347 5 50 1647292 4815552 6 50 1647737 4815410 7 74 1647555 4815201 8 74 1647464 4815023 9 74 1646970 4815129 10 74 1646895 4815264 11 74 164

[R] data.frame to shape

2006-08-09 Thread Leonardo Lami
Hi all, I have a simple question: I have a data.frame like this: id x y 1 50 1647685 4815259 2 50 1647546 4815196 3 50 1647454 4815294 4 50 1647405 4815347 5 50 1647292 4815552 6 50 1647737 4815410 7 74 1647555 4815201 8 74 1647464 4815023 9 74 1646970 4815129 10 74 1646895 481

Re: [R] R2HTML: request for an extended example

2006-08-09 Thread Tobias Verbeke
Michael Kubovy wrote: > Dear R-helpers, > > If you know of an extended example of the use of R2HTML, in which the > various constructs are present in one place, could you please point > me to it or send it to me? > There was an article in the R News of December 2003 http://cran.r-project.or

[R] R2HTML: request for an extended example

2006-08-09 Thread Michael Kubovy
Dear R-helpers, If you know of an extended example of the use of R2HTML, in which the various constructs are present in one place, could you please point me to it or send it to me? _ Professor Michael Kubovy University of Virginia Department of Psychology USPS:

Re: [R] scaling constant in optim("L-BFGS-B")

2006-08-09 Thread Dimitris Rizopoulos
maybe it would be better to scale the parameters (using 'parscale') instead of NLL. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336

[R] 2 places on R course

2006-08-09 Thread Highland Statistics Ltd.
Apologies for cross-posting There are two places available on a 3-day R course in Newburgh, UK (28-30 August 2006). Full details can be found at: www.brodgar.com Kind regards, Alain Zuur Highland Statistics Ltd. __ R-help@stat.math.ethz.ch mailing

[R] scaling constant in optim("L-BFGS-B")

2006-08-09 Thread Simon Ruegg
Hi all, I am trying to find estimates for 7 parameters of a model which should fit real data. I have a function for the negative log likelihood (NLL) of the data. With optim(method="L-BFGS-B",lower=0) I am now minimizing the NLL to find the best fitting parameters. My problem is that the a

Re: [R] evolutionary computing in R

2006-08-09 Thread Rau, Roland
Hi Christian, the language spoken on this mailing list is English not German. As far as I know there is one package called "gafit" which is intended for... library(gafit) ?gafit ...Genetic Algorithm for Curve Fitting Is this something you are looking for? For non-German speakers who are probab

Re: [R] evolutionary computing in R

2006-08-09 Thread Gabor Grothendieck
Check out the machining learning task view at: http://cran.r-project.org/src/contrib/Views/ On 8/9/06, Christian Miehle <[EMAIL PROTECTED]> wrote: > Hallo, > > Ich bin auf der Suche nach umgesetzten evolutionären Algorithmen in R. Leider > habe ich kein entsprechendes Package oder Funktionen die

[R] evolutionary computing in R

2006-08-09 Thread Christian Miehle
Hallo, Ich bin auf der Suche nach umgesetzten evolutionären Algorithmen in R. Leider habe ich kein entsprechendes Package oder Funktionen dieser Verfahrensgruppe gefunden. Weiß zufällig jemand, ob Funktionen oder Pakete zu dieser Problematik in R existieren? Vielen Dank, Christian [[a

Re: [R] missing documentation entries

2006-08-09 Thread Adrian Dusa
On Wednesday 09 August 2006 14:37, Prof Brian Ripley wrote: > This is discussed in `Writing R Extensions', which both points you to the > 'internal' keyword, and (in the current version) mentions using name > spaces to hide such functions. > > This really was a question for R-devel: please do study

Re: [R] Getting data out of a loop

2006-08-09 Thread John Kane
My thanks to, in order of the postings appearance at my reader, Jim Holtman, Andrew Robinson & Neuro LeSuperHéros for thre different and very useful solutions to my problem. Your help is greatly appreciated. --- Neuro LeSuperHéros <[EMAIL PROTECTED]> wrote: > I'd create an empty dataframe prio

Re: [R] legend on trellis plot

2006-08-09 Thread Gabor Grothendieck
1. Use the x, y and corner components to the key= list to specify the legend position, and 2. pass the panel.number in the panel function and test that as shown in the panel function below. Alternately you can place the horizontal line on afterwards using trellis.focus/trellis.unfoc

Re: [R] missing documentation entries

2006-08-09 Thread Prof Brian Ripley
This is discussed in `Writing R Extensions', which both points you to the 'internal' keyword, and (in the current version) mentions using name spaces to hide such functions. This really was a question for R-devel: please do study the posting guide. `R-devel is intended for questions and disc

Re: [R] between-within anova: aov and lme

2006-08-09 Thread Spencer Graves
I can't answer your question about 'aov', but have you tried the following with 'lme': lme(response~A*B*C,random=~1|subject) This assumes that A, B, and C are fixed effects, either continuous variables or factors present at only a very few levels whose effects are

[R] legend on trellis plot

2006-08-09 Thread Henrik Agersø
Dear all I have two questions regarding trellis plots - which I hope you may be able to help me with. Is it possible to place the key in a trellis plot on the panel (instead of beside the panel)? This will cause the same key to be reproduced on each panel. Please see the plot below - here I p

[R] Joint confidence intervals for GLS models?

2006-08-09 Thread Kennedy David
Dear All, I would like to be able to estimate confidence intervals for a linear combination of coefficients for a GLS model. I am familiar with John Foxton's helpful paper on Time Series Regression and Generalised Least Squares (GLS) and have learnt a bit about the gls function. I have downloa

[R] missing documentation entries

2006-08-09 Thread Adrian Dusa
Dear list, When creating a package, there are always many little utility functions that belong to the "internal kitchen" of the main, documented functions. Now, when checking the sources with R CMD check, I get a warning for those little functions that are not documented. I would have two quest

[R] solving nonlinear equations in R

2006-08-09 Thread Demirtas, Hakan
Hi, I can't seem to get computationally stable estimates for the following system: Y=a+bX+cX^2+dX^3, where X~N(0,1). (Y is expressed as a linear combination of the first three powers of a standard normal variable.) Assuming that E(Y)=0 and Var(Y)=1, one can obtain the following equations after ted

Re: [R] prefixing list names in print

2006-08-09 Thread Laurent Deniau
bogdan romocea wrote: > A simple function will do what you want, customize this as needed: > lprint <- function(lst,prefix) > { > for (i in 1:length(lst)) { > cat(paste(prefix,"$",names(lst)[i],sep=""),"\n") > print(lst[[i]]) > cat("\n") > } > } > P <- list(A="a",B="b") > lprint(P,"Prefix")

[R] NLS and IV

2006-08-09 Thread John Janmaat
Hello All, I'm looking to test a variable in a logit model (glm(..., binomial(link="logit"))) for exogeneity (endogeneity). At this point I am planning to try implementing Jeffery Grogger's "A Simple Test for Exogeneity in Probit, Logit, and Poisson Regression Models", Economic Letters, 1990. To

Re: [R] locating intervals

2006-08-09 Thread Martin Maechler
I'm pretty sure you want to use findInterval() Why did you not find it? In other words, what did you try to find it? Regards, Martin Maechler, ETH Zurich > "halldor" == halldor bjornsson <[EMAIL PROTECTED]> > on Tue, 8 Aug 2006 16:47:18 + writes: halldor> Hi , I have two

Re: [R] nested ANOVA using lme

2006-08-09 Thread Dimitris Rizopoulos
in lme() you need to specify the random-effects with a formula passed to the 'random' argument, e.g., something like fit <- lme(Diam ~ Env + Site, random = ~ 1 | Env / Site, data = environ) summary(fit) I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Cen

Re: [R] Take random sample from class variable

2006-08-09 Thread Muhammad Subianto
Dear all, Andy, thanks you for your help and suggestions. This is exactly what I was looking for. Kindly regards, Muhammad Subianto On 8/8/06, Liaw, Andy <[EMAIL PROTECTED]> wrote: > There may be better ways, but this should work: > > R> p.yes <- 0.7 > R> n.yes <- rbinom(1, nof.sample, p.yes) >

[R] nested ANOVA using lme

2006-08-09 Thread David Semmens
I have an ANOVA model with 2 factors "Environment" and "Site", "Diameter" is the response variable. Site should be nested within Environment. Site is also a random factor while Environment is fixed. I can do this analysis using the "aov" function by using these commands: >model<-aov(Diam~Env+E

Re: [R] RE

2006-08-09 Thread Spencer Graves
I've never used the 'bayesm' package, but your question sounded interesting and I've not seen a reply, so I decided to look at it. Unfortunately, I couldn't make sense of your example in the time available. Instead, I will offer a few more general questions / suggests that I hope mig

[R] CRAN package: update of 'vars' submitted

2006-08-09 Thread Pfaff, Bernhard Dr.
Dear useR! an updated version of package 'vars' has been shipped to CRAN lately. Information on package 'vars': == Title: VAR Modelling Version: 0.1.3 Date: 2006-07-27 Author:Bernhard Pfaff Maintainer:Bernhard Pfaff Depends: R

[R] exponential proportional hazard model

2006-08-09 Thread Daniel Gutknecht
Dear R-users, I am looking for a function designed to handle parametric proportional hazard models with a piecewise constant baseline hazard (i.e. dummies for annual intervals) and time-dependent covariates since I'm especially interested about the effect of those covariates on the baseline haz

  1   2   >