Re: [R] fitting truncated normal distribution

2006-08-17 Thread Schweitzer, Markus
Sorry, that I forgot an example. I have demand-data which is either 0 or a positive value. When I have an article which is not ordered very often, it could look like this: x=c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1280,0,0,0,0,640,0,0 ,0,0,0,0,0,0,0) library(MASS) ## for fitdistr

Re: [R] Setting contrasts for polr() to get same result of SAS

2006-08-17 Thread Gregor Gorjanc
T Mu muster at gmail.com writes: Hi all, I am trying to do a ordered probit regression using polr(), replicating a result from SAS. polr(y ~ x, dat, method='probit') suppose the model is y ~ x, where y is a factor with 3 levels and x is a factor with 5 levels, To get coefficients,

Re: [R] help about agnes

2006-08-17 Thread Martin Maechler
Arnau == Arnau Mir Torres [EMAIL PROTECTED] on Wed, 16 Aug 2006 19:38:27 +0200 writes: Arnau Hello. Arnau I have the following distance matrix between 8 points: Arnau [1,] 0.00 3.162278 7.280110 8.544004 7.071068 9.899495 6.403124 8.062258 Arnau [2,] 3.162278

Re: [R] nls convergence problem

2006-08-17 Thread Dieter Menne
nls not converging for zero-noise cases Setzer.Woodrow at epamail.epa.gov writes: No doubt Doug Bates would gladly accept patches ... . The zero-noise case is irrlevant in practice, but quite often I have uttered /(!! (vituperation filter on) when nls did not converge with real data. The

Re: [R] separate row averages for different parts of an array

2006-08-17 Thread Gabor Grothendieck
The following reshapes mat so we can take the means of the columns of the resulting 3d array and then transposes it back to the original orientation: t(colMeans(array(t(mat), c(100, 448, 24 You might want to try it on this test set first where anscombe is an 11x8 data set built into R.

Re: [R] Problem with the special argument '...' within a function

2006-08-17 Thread Jim Lemon
Hans-Joerg Bibiko wrote: Dear all, I wrote some functions using the special argument '...'. OK, it works. But if I call such a function which also called such a function, then I get an error message about unused arguments. Here's an example: fun1 - function(x,a=1) {

Re: [R] day, month, year functions

2006-08-17 Thread Martin Maechler
Gregor == Gregor Gorjanc [EMAIL PROTECTED] on Fri, 11 Aug 2006 00:27:27 + (UTC) writes: Gregor Gabor Grothendieck ggrothendieck at gmail.com writes: Here are three ways: xx - as.Date(2006-01-05) # 1. use as.POSIXlt as.POSIXlt(xx)$mday

Re: [R] day, month, year functions

2006-08-17 Thread Gregor Gorjanc
Martin Maechler wrote: Gregor == Gregor Gorjanc [EMAIL PROTECTED] on Fri, 11 Aug 2006 00:27:27 + (UTC) writes: Gregor Gabor Grothendieck ggrothendieck at gmail.com writes: Here are three ways: xx - as.Date(2006-01-05) # 1. use as.POSIXlt

Re: [R] rpvm/snow packages on a cluster with dual-processor machi nes

2006-08-17 Thread Ramon Diaz-Uriarte
Dear Paul, (I forgot to answer over the weekend). With mpi it is essentially the same. When using makeCluster, specify the number of slaves. If you have three machines, and you want each to run two slave processes, just use a 6. Before that, though, you should tell LAM/MPI how to set up the

[R] tkinser

2006-08-17 Thread julie7\.josse
Dear list, I 'd like to know if it is possible to delete my text window after running it?? I have add a Menu to my text window and so i can for example open a script; then i run it and i have my result on my R console. But i'd like that after running, the code disappears automatically. i d'like

[R] NLME: Limitations of using identify to interact with scatterplots?

2006-08-17 Thread Greg Distiller
I have a quick question regarding the use of identify to interact with points on a scatterplot. My question is essentially: can identify be used when one is plotting model objects to generate diagnostic plots? Specifically I am using NLME. For example, I am plotting the fitted values on the x

Re: [R] glmmPQL question!

2006-08-17 Thread Simon Wood
Will this do? best, Simon ## simulate some data... set.seed(1) joint - c(rep(1,20),rep(2,20),rep(3,20)) time - runif(60)+1 subject - factor(rep(1:12,rep(5,12))) mu - time*joint joint - factor(joint) y - rgamma(mu,mu) ## fit model b -

Re: [R] Specifying Path Model in SEM for CFA

2006-08-17 Thread Rick Bilonick
On Wed, 2006-08-16 at 17:01 -0400, John Fox wrote: Dear Rick, It's unclear to me what you mean by constraining each column of the factor matrix to sum to one. If you intend to constrain the loadings on each factor to sum to one, sem() won't do that, since it supports only equality

Re: [R] tkinser

2006-08-17 Thread John Fox
Dear Julie, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of julie7.josse Sent: Thursday, August 17, 2006 4:01 AM To: r-help Subject: [R] tkinser Importance: High Dear list, I 'd like to know if it is possible to delete my text window

Re: [R] Specifying Path Model in SEM for CFA

2006-08-17 Thread John Fox
Dear Rick, -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rick Bilonick Sent: Thursday, August 17, 2006 7:07 AM To: John Fox Cc: 'R Help'; 'Rick Bilonick' Subject: Re: [R] Specifying Path Model in SEM for CFA . . . I'm trying to build a

Re: [R] Plots Without Displaying

2006-08-17 Thread Lothar Botelho-Machado
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you, It seems that a list of plots is just possible using lattice plots. But that's a good keyword for me to look for, I appreciate your help! Lothar Christos Hatzis wrote: Yes, you can do that for lattice-based plots. The functions in the

Re: [R] NLME: Limitations of using identify to interact with scatterplots?

2006-08-17 Thread Douglas Bates
Most plotting functions in the nlme package use lattice graphics functions based on the grid package. Identify will not work with lattice graphics. I'm not sure if there is a replacement. On 8/17/06, Greg Distiller [EMAIL PROTECTED] wrote: I have a quick question regarding the use of identify

Re: [R] Plots Without Displaying

2006-08-17 Thread Gabor Grothendieck
Also check out the displaylist: http://tolstoy.newcastle.edu.au/R/help/04/05/0817.html On 8/17/06, Lothar Botelho-Machado [EMAIL PROTECTED] wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you, It seems that a list of plots is just possible using lattice plots. But that's a good

Re: [R] fitting truncated normal distribution

2006-08-17 Thread Sundar Dorai-Raj
Hi, Markus, Are these always integers? Why do you think they should be normal or Weibull? Seems more like a mixture with a point mass at 0 and something else (e.g. Poisson, negative binomial, normal). Though it's hard to tell with what you have provided. If that's the case you'll have to write

Re: [R] Plots Without Displaying

2006-08-17 Thread Prof Brian Ripley
On Thu, 17 Aug 2006, Lothar Botelho-Machado wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Thank you, It seems that a list of plots is just possible using lattice plots. But that's a good keyword for me to look for, I appreciate your help! Actually, that is not a list of *plots*.

Re: [R] Variance Components in R

2006-08-17 Thread Iuri Gavronski
Thank you for your reply. VARCOMP is available at SPSS advanced models, I'm not sure for how long it exists... I only work with SPSS for the last 4 years... My model only has crossed random effects, what perhaps would drive me to lmer(). However, as I have unbalanced data (why it is normally

Re: [R] Variance Components in R

2006-08-17 Thread Doran, Harold
Iuri: The lmer function is optimal for large data with crossed random effects. How large are your data? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Iuri Gavronski Sent: Thursday, August 17, 2006 11:08 AM To: Spencer Graves Cc:

Re: [R] Variance Components in R

2006-08-17 Thread Doran, Harold
This will (should) be a piece of cake for lmer. But, I don't speak SPSS. Can you write your model out as a linear model and give a brief description of the data and your problem? In addition to what Spencer noted as help below, you should also check out the vignette in the mlmRev package. This

[R] Fwd: Variance Components in R

2006-08-17 Thread Iuri Gavronski
9500 records. It didn`t run in SPSS or SAS on Windows machines, so I am trying to convert the SPSS script to R to run in a RISC station at the university. On 8/17/06, Doran, Harold [EMAIL PROTECTED] wrote: Iuri: The lmer function is optimal for large data with crossed random effects. How

Re: [R] Specifying Path Model in SEM for CFA

2006-08-17 Thread Rick Bilonick
sem() handles only equality constraints among parameters, and this model requires linear inequality constraints. I'm aware of SEM software that handles inequality constraints, but I'm not aware of anything in R that will do it out of the box. One possibility is to write out the likelihood

Re: [R] Plots Without Displaying

2006-08-17 Thread hadley wickham
Yes, you can do that for lattice-based plots. The functions in the lattice package produce objects of class trellis which can be stored in a list and processed or updated at a later time: Or for ggplot based plots: install.packages(ggplot) library(ggplot) plotList - list(length=3)

Re: [R] Variance Components in R

2006-08-17 Thread Spencer Graves
Hi, Iuri: If you've got an 8086 AND a huge data set, compute time might be a problem with 'lmer'. However, if you a reasonably modern computer and only a a few thousand observations, 'lmer' should complete almost in the blink of an eye -- or at least in less time than it would talk for

Re: [R] Fwd: Variance Components in R

2006-08-17 Thread Spencer Graves
Hi, Iuri: How much RAM and how fast a microprocessor (and what version of Windows) do you have? You might still try it in R under Windows. The results might be comparable or dramatically better in R than in SPSS or SAS. hope this helps. Spencer Graves Iuri Gavronski

Re: [R] Fwd: Variance Components in R

2006-08-17 Thread Iuri Gavronski
We have tried on many machines, from my laptop to a dual core Intel processor with 1GB of RAM. On 8/17/06, Spencer Graves [EMAIL PROTECTED] wrote: Hi, Iuri: How much RAM and how fast a microprocessor (and what version of Windows) do you have? You might still try it in R under Windows.

Re: [R] Variance Components in R

2006-08-17 Thread Iuri Gavronski
I am trying to replicate Finn and Kayandé (1997) study on G-theory application on Marketing. The idea is to have people evaluate some aspects of service quality for chains on different economy sectors. Then, conduct a G-study to identify the generalizability coefficient estimates for different

Re: [R] nls convergence problem

2006-08-17 Thread Dieter Menne
Yours truly dieter.menne at menne-biomed.de writes: ... Recently, a colleague fitted gastric emptying curves using GraphPad, with 100% success, and nls failed for one third of these. When we checked GraphPads output more closely, some of the coefficients looked like 2.1 with a confidence

Re: [R] Fwd: Variance Components in R

2006-08-17 Thread Spencer Graves
Burt Gunter just reminded me that the completion time could also be affected by the numbers of levels of each of the factors, especially random effects: With N records, any variance components / mixed model software using MLE or REML will have to invert repeatedly an N x N matrix for

[R] rbind-ing vectors inside lists

2006-08-17 Thread Domenico Vistocco
Dear helpeRs, suppose I have two lists as follows: a = list(1:5,5:9) b = lapply(a,*,2) I would like to rbind-ing the two lists, that is I would like to use something as rbind applied component to component for the two list. I have used the following solution: fun.tile.wt = function(list1,

Re: [R] rbind-ing vectors inside lists

2006-08-17 Thread Gabor Grothendieck
Try: mapply(rbind, a, b, SIMPLIFY = FALSE) On 8/17/06, Domenico Vistocco [EMAIL PROTECTED] wrote: Dear helpeRs, suppose I have two lists as follows: a = list(1:5,5:9) b = lapply(a,*,2) I would like to rbind-ing the two lists, that is I would like to use something as rbind applied

[R] unlink disables help?

2006-08-17 Thread Kuhn, Max
I was hoping that someone could try to reproduce an error that I am getting. The R Site Search keeps timing out on me, so apologies of this has already come up. I'm using R.version _ platform i386-pc-mingw32 arch i386

Re: [R] rbind-ing vectors inside lists

2006-08-17 Thread Richard M. Heiberger
## initial example a = list(1:5, 5:9) b = lapply(a,*,2) library(abind) ## you may need to download abind from CRAN abind(data.frame(a), data.frame(b), along=.5) ## data.frames with column names a = data.frame(first=1:5, second=5:9) b = a^2 abind(a, b, along=.5, new.names=c(a,b))

[R] R Site Search directly from Firefox's address bar

2006-08-17 Thread Adrian Dusa
Dear list, For all those interested who use Firefox as the main browser, here is a quick way to make R related searches: type about:config in the address bar search for keyword.url and modify it to

Re: [R] unlink disables help?

2006-08-17 Thread Peter Dalgaard
Kuhn, Max [EMAIL PROTECTED] writes: I was hoping that someone could try to reproduce an error that I am getting. The R Site Search keeps timing out on me, so apologies of this has already come up. I'm using R.version never mind When I use unlink as below, the help system is

Re: [R] day, month, year functions

2006-08-17 Thread Gabor Grothendieck
On 8/17/06, Martin Maechler [EMAIL PROTECTED] wrote: Gregor == Gregor Gorjanc [EMAIL PROTECTED] on Fri, 11 Aug 2006 00:27:27 + (UTC) writes: Gregor Gabor Grothendieck ggrothendieck at gmail.com writes: Here are three ways: xx - as.Date(2006-01-05) #

Re: [R] R Site Search directly from Firefox's address bar

2006-08-17 Thread Peter Dalgaard
Adrian Dusa [EMAIL PROTECTED] writes: Dear list, For all those interested who use Firefox as the main browser, here is a quick way to make R related searches: type about:config in the address bar search for keyword.url and modify it to

[R] Boxplot Help: Re-ordering the x-axis

2006-08-17 Thread Pamela Allen
I am having a problem using boxlpot with my data. I have my data arranged in a data table, and two of my columns are mass and month. I am trying to plot the mass of my study animals by month, thus I would like to have it in the order of January to December. The problem is that R orders each

Re: [R] R Site Search directly from Firefox's address bar

2006-08-17 Thread Adrian Dusa
On Thursday 17 August 2006 21:41, Peter Dalgaard wrote: [...] Breaks the feature that you get to www.r-project.org just by typing r, though... Oh, this is very simple to fix. I created a bookmark named R with the above location and assigned it a keyword r. Now, everytime I type r in the

Re: [R] Boxplot Help: Re-ordering the x-axis

2006-08-17 Thread Marc Schwartz (via MN)
On Thu, 2006-08-17 at 11:46 -0700, Pamela Allen wrote: I am having a problem using boxlpot with my data. I have my data arranged in a data table, and two of my columns are mass and month. I am trying to plot the mass of my study animals by month, thus I would like to have it in the order of

Re: [R] Boxplot Help: Re-ordering the x-axis

2006-08-17 Thread Richard M. Heiberger
month.name class(month.name) character tmp - data.frame(m=rep(month.name, 2), y=rnorm(24)) bwplot(y ~ m, data=tmp) tmp - data.frame(m=ordered(rep(month.name, 2), levels=month.name), y=rnorm(24)) bwplot(y ~ m, data=tmp) __ R-help@stat.math.ethz.ch

[R] problem with cut(as.Date(2006-08-14), week)

2006-08-17 Thread Mikkel Grum
When I run cut.Date or cut.POSIXt with argument breaks = weeks, the function gives the first day of that week, unless the date is the first day of the week, in which case it gives an error message as in: cut(as.Date(2006-08-16), week) [1] 2006-08-14 Levels: 2006-08-14 cut(as.Date(2006-08-14),

Re: [R] NLME: Limitations of using identify to interact with scatterplots?

2006-08-17 Thread Paul Murrell
Hi Take a look at panel.identify() (in the 'lattice' package). I'm not sure if it will help you because I cannot run your example code. Paul Douglas Bates wrote: Most plotting functions in the nlme package use lattice graphics functions based on the grid package. Identify will not work

[R] Rgraphviz fails to load

2006-08-17 Thread Michael Kubovy
Dear r-helpers, Can anyone suggest a remedy to the following failure of Rgraphviz to load? library(Rgraphviz) Loading required package: graph Loading required package: Ruuid Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library

[R] Simulate p-value in lme4

2006-08-17 Thread Manuel Morales
Dear list, This is more of a stats question than an R question per se. First, I realize there has been a lot of discussion about the problems with estimating P-values from F-ratios for mixed-effects models in lme4. Using mcmcsamp() seems like a great alternative for evaluating the significance of

Re: [R] Variance Components in R

2006-08-17 Thread Doran, Harold
Iuri: Here is an example of how a model would be specified using lmer using a couple of your factors: fm - lmer(response.variable ~ chain*sector*resp +(chain*sector*resp|GroupingID), data) This will give you a main effect for each factor and all possible interactions. However, do you have

[R] getting sapply to skip columns with non-numeric data?

2006-08-17 Thread r user
getting s-apply to skip columns with non-numeric data? I have a dataframe “x” of w columns. Some columns are numeric, some are not. I wish to create a function to calculate the mean and standard deviation of each numeric column, and then “bind” the column mean and standard deviation to the

Re: [R] R Site Search directly from Firefox's address bar

2006-08-17 Thread Charles Berry
Adrian Dusa dusa.adrian at gmail.com writes: On Thursday 17 August 2006 21:41, Peter Dalgaard wrote: [...] Breaks the feature that you get to www.r-project.org just by typing r, though... Oh, this is very simple to fix. I created a bookmark named R with the above location and

Re: [R] getting sapply to skip columns with non-numeric data?

2006-08-17 Thread Gabor Grothendieck
Use the first few rows of iris as test data and try this where isnum is 1 for each numeric column and NA for others. irish - head(iris) isnum - ifelse(sapply(iris, class) == numeric, 1, NA) iris.data - data.matrix(iris) rbind(iris, colMeans(iris.data) * isnum, sd(iris.data) * isnum) On 8/17/06,

Re: [R] getting sapply to skip columns with non-numeric data?

2006-08-17 Thread Liaw, Andy
There's something that either you have not thought of or neglected to tell us: If you have k variables in the data frame, you will need a data frame of k variables and one row to be able to rbind() to the bottom of the original one. What are you going to put in place for non-numeric variables?

[R] DSC 2007

2006-08-17 Thread Paul Murrell
Hi This is a second call for abstracts. Please forward and circulate to other interested parties. [apologies for any cross-posting] DSC 2007, a conference on systems and environments for statistical computing, will take place in Auckland, New Zealand on February 15 16, 2007. We invite

[R] Font-path error when starting X11 device in Gentoo

2006-08-17 Thread Toby Muhlhofer
Dear R listers, If I try to start the X11 device in Gentoo, I get the following complaint from R: --- X11() Error in X11() : could not find any X11 fonts Check that the Font Path is correct. --- xset -q produces the following output: ---

[R] Fitting Truncated Lognormal to a truncated data set (was: fitting truncated normal distribution)

2006-08-17 Thread xpRt.wannabe
Dear List, I am trying to fit Truncated Lognormal to a data set that is 'truncated' from above a certain value, say, 0.01. Below is what I was able to come up with. I would appreciate it if you could review and make any necessary changes. # This is modified off the code for 'dtnorm' of

Re: [R] NLME: Limitations of using identify to interact with scatterplots?

2006-08-17 Thread Andrew Robinson
Many useful diagnostic plots can be recreated in the usual plot() framework, with only a little coding effort. In this case, I would imagine that plot(dframe$log2game, fitted(D2C29.nlme)) abline(0,1) should get pretty close, if the name of the dataframe containing the variable is 'dframe'.

[R] Lattice package par.settings/trellis.par.settings questions

2006-08-17 Thread Debarchana Ghosh
Hi All, I'm trying to modify some of the default graphic parameters in a conditional histogram. While I was able to change the default grey background to white, I couldn't change the axis.font or the xlab font. I used the following code: /histogram(~V751|V013+V025, finalbase, xlab=Heard of

Re: [R] Lattice package par.settings/trellis.par.settings questions

2006-08-17 Thread Gabor Grothendieck
The parameter names are axis.text$font and axis.text$cex . Try issuing the command: trellis.par.get() to get a complete list. Here is an example: histogram(1:10, par.settings = list(axis.text = list(font = 2, cex = 0.5))) On 8/17/06, Debarchana Ghosh [EMAIL PROTECTED] wrote: Hi All, I'm

Re: [R] Lattice package par.settings/trellis.par.settings questions

2006-08-17 Thread Anupam Tyagi
Please read about lattice.par.settings, and not trellis.par.settings. Trellis is in S/S-plus. Anupam. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide