Re: [R] Adding a distance scale to a plot?

2010-01-04 Thread Jim Lemon
On 01/05/2010 04:12 AM, Jason Rupert wrote: Do you know what steps I need to take to add a scale to a plot? I'm pulling my example out of "An Introduction to R: Software for StatisticalModelling& Computing" (see the R code around Figure 76). I would like to add a scale to the image produced

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Schalk, Thank you very much for this. Noli On 1/5/10, Schalk Heunis wrote: > Hi > > You can use the reshape package to achieve this. If you don't have it > installed, install.packages('reshape'). Then look at ?cast and (possibly) > ?melt > HTH! > > Schalk > > > On Tue, Jan 5, 2010 at 7:59 AM

[R] Fast nested List->data.frame

2010-01-04 Thread Dieter Menne
I have very large data sets given in a format similar to d below. Converting these to a data frame is a bottleneck in my application. My fastest version is given below, but it look clumsy to me. Any ideas? Dieter # --- len = 10 d = replicate(len, list(pH = 3,marker = TRU

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-04 Thread Dennis Murphy
Hi: I think Santosh wants a Lattice version of matplot. I didn't find anything with help.search(), though... Dennis On Mon, Jan 4, 2010 at 8:14 PM, Santosh wrote: > Hi, > Thanks for your email.. > > Each panel (in a multiple panel) is identified by "DS1, DS2 & DS3" in the > dataset sent earlie

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Schalk Heunis
Hi You can use the reshape package to achieve this. If you don't have it installed, install.packages('reshape'). Then look at ?cast and (possibly) ?melt HTH! Schalk On Tue, Jan 5, 2010 at 7:59 AM, Noli Sicad wrote: > Hi, > > I need to transpose and aggregate the 4th and 5th column of this d

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Sorry, the second email is accidently sent. Yes, the Cut Area should not be included in the data in the first email. The second email has a correct data. Thanks. Noli __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

Re: [R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
> From: > P_ID CROP Period Ini_Age CROP_ID CROPTYPEPeriod Ini_Age 83 SORI 131 84 SORI1 32 85 SORI 1 33 86 SORI 1 34 82 SORI 2 28 83 SORI 2 29 84 SORI 2 30 93 SORM2 35 62

[R] Tranpose and Aggregate Data

2010-01-04 Thread Noli Sicad
Hi, I need to transpose and aggregate the 4th and 5th column of this data set (below). The period is 1 to 100 years and some period has 1 entry as shown in the example below. Any ideas how to do this. Thanks in advance. Noli ~~ From: P_ID CROP Period Ini_Age Area_Cut 83 SORI

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-04 Thread Duncan Mackay
Hi I missed the earlier emails and I am not too sure of what you want but have a look at requiire(latticeExtra) ? useOuterStrips It may improve the layout and readability Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 Email Home: mac...@nor

Re: [R] Checking for normality and homogeneity of variance

2010-01-04 Thread Schalk Heunis
For normality check out: ?shapiro.test HTH! Schalk On Tue, Jan 5, 2010 at 5:32 AM, Haiyang AI wrote: > Dear all, > > I'm a beginner of R and I need to carry out some three-way mixed ANOVAs. > Following examples at http://personality-project.org/r/r.anova.html, I > managed to get the ANOVA part,

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-04 Thread Santosh
Hi, Thanks for your email.. Each panel (in a multiple panel) is identified by "DS1, DS2 & DS3" in the dataset sent earlier. I would like an overlay of Y1, Y2 & Y3 (each by different lines) for each ID in the group. Each ID in the group is represented by a color. Regards & Thanks, Santosh On Mon,

[R] Error on checking a package with some functions ignored

2010-01-04 Thread rusers.sh
Hi, Say i have three functions in a new package, a,b and c. I only want the one function "a" to be exported for use. "b" and "c" are not very stable. If i specify to export all the three functions in the NAMESPACE file (export(a,b,c)), no errors appeared after checking the package. But if i onl

[R] Checking for normality and homogeneity of variance

2010-01-04 Thread Haiyang AI
Dear all, I'm a beginner of R and I need to carry out some three-way mixed ANOVAs. Following examples at http://personality-project.org/r/r.anova.html, I managed to get the ANOVA part, but I don't know how can I check data normality and homogeneity of variance in R (since they're the required assu

[R] Bar plots with stacked and grouped (juxtaposed) bars together

2010-01-04 Thread Elmer Wix
Using barplot, I can generate stacked bars if I pass beside=FALSE. I can generate grouped (juxtaposed) bars if I pass beside=TRUE. How can I generate stacked and grouped bars together? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/l

Re: [R] Extract vector elements until cumsum <= x

2010-01-04 Thread Gabor Grothendieck
Mark Leeds pointed out to me that the last line should have been: Reduce(f, x, accumulate = TRUE) On Mon, Jan 4, 2010 at 8:43 AM, Gabor Grothendieck wrote: > Try this which uses 10 as the check value: > > f <- function(acc, x) if (acc + x > 10) x else acc + x > x <- c(4, 6, 2, 7, 4, 1, 4, 8) > R

Re: [R] R matching lat/lon pairs from two datasets?

2010-01-04 Thread jim holtman
couple of approaches: > merge(data1, data2, by.x=c("V1", "V2"), by.y=c("V2", "V1")) V1 V2 V3 1 47.82 -123.75 11 2 47.82 -123.76 8 > library(sqldf) > sqldf("select * from data2 x2, data1 x1 where x2.V1=x1.V2 and x2.V2=x1.V1") V1V2 V3 V1V2 1 -123.76 47.82 8 -123.76 47

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-04 Thread Peter Ehlers
Can you clarify how many curves you want in each panel? You have 3 Ys and your original email indicated at least 7 ID values. Do you really want 21 curves in each panel? Or do you want separate panels for the Ys? Re your code: note that, regarding a formula of the type y1 + y2 ~ x, ?xyplot says:

Re: [R] R matching lat/lon pairs from two datasets?

2010-01-04 Thread Don MacQueen
I guess you want the subset of "data" whose lat/long pairs are present in "data2"? Try renaming your columns so that V1 and V2 are the same in both data frames (either lat,long, or long,lat, but not one way in one dataframe and the other way in the other one. Then use merge() -Don At 5:37

Re: [R] MLE optimization

2010-01-04 Thread jckval
First of all, thanks for your answer! About the optimization problem, I'm pretty careful on constraints for the parameters. Regular papers usually do this kind of estimation just restricting the weight of the mixture (bivariate) between 0 and 1, but this can lead to some strange results, like neg

[R] R matching lat/lon pairs from two datasets?

2010-01-04 Thread Douglas M. Hultstrand
Hello, I am trying to match lat/lon from one dataset with the lat/lon from a second dataset and use that rows data for calculations. I am using match, but this is finding the first match and not comparing the pair, how can I determine if the lat/lon are the same? See example below. Is ther

Re: [R] Dynamic arguments in "rbind" function

2010-01-04 Thread Sundar Dorai-Raj
Use a list instead of assign then do.call("rbind", thelist). import.files <- c("a.txt", "b.txt", "c.txt", "d.txt", "e.txt") imp <- vector("list", length(import.files)) for (i in 1:length(import.files)) { imp[[i]] <- read.delim(import.files[i], sep = "", header = TRUE) } combined <- do.call("

Re: [R] Dynamic arguments in "rbind" function

2010-01-04 Thread Duncan Murdoch
On 04/01/2010 7:31 PM, Steven Kang wrote: Hi, all Basically, I have unknown number of data that need to be imported and collapsed row-wisely. The code below works fine, however the "rbind" function may require 50 arguments if there are 50 data files... Thus, I would like to explore whether the

[R] Dynamic arguments in "rbind" function

2010-01-04 Thread Steven Kang
Hi, all Basically, I have unknown number of data that need to be imported and collapsed row-wisely. The code below works fine, however the "rbind" function may require 50 arguments if there are 50 data files... Thus, I would like to explore whether there are any methods in using dynamic objects

Re: [R] how to plot multiple density functions in one graph

2010-01-04 Thread Dennis Murphy
Hi: Another approach to multiple plotting in base graphics is to use matplot, which is particularly convenient for something such as densities because the plots are of a similar character with the same domain. Here's an example: x <- seq(0, 1, by = 0.01) d1 <- dbeta(x, 2, 2) d2 <- dbeta(x, 3, 3)

Re: [R] MLE optimization

2010-01-04 Thread Liviu Andronic
Hello On 1/4/10, jckval wrote: > Alternatively, could anyone suggest a good MLE tutorial and package? > Search for "MLE" on Rseek.org and among other results check the Task Views. Also, search for "MLE" in "vignettes" on RSiteSearch [1]. [1] http://finzi.psych.upenn.edu/nmz.html To get a good l

Re: [R] MLE optimization

2010-01-04 Thread Ravi Varadhan
"should write a function that uses the parameters and the sample data as input and outputs the likelihood. Is it correct?" Yes, that is correct. Take a look at the optim() function. ?optim What type of convergence problems did you experience with Matlab? I am not sure if using R can overcome fu

[R] MLE optimization

2010-01-04 Thread jckval
Folks, I'm kind of newbie in R, but with some background in Matlab and VBA programming. Last month I was implementing a Maximum Likelihood Estimation in Matlab, but the algorithms didn't converge. So my academic advisor suggested using R. My problem is: estimate a mean reverting jump diffusion pa

Re: [R] How to uninstall R packages

2010-01-04 Thread Charlie Sharpsteen
On Mon, Jan 4, 2010 at 7:37 AM, David Winsemius wrote: > > On Jan 4, 2010, at 10:23 AM, Uwe Ligges wrote: > >> >> >> On 04.01.2010 16:20, wenjun zheng wrote: >>> >>> Dear all, >>> >>> I am puzzled that how can i uninstall a R package that have been >>> installed earlier (especially in MacOS). >>>

Re: [R] polygamma or Hurwitz zeta function

2010-01-04 Thread Duncan Murdoch
On 04/01/2010 5:27 PM, HAKAN DEMIRTAS wrote: Hi, Is there any R library that is capable of handling polygamma function (Hurwitz zeta function also works)? I am aware of digamma(0 and trigamma(), but could not find more advanced versions. RSiteSearch("polygamma") points to the psigamma functi

[R] polygamma or Hurwitz zeta function

2010-01-04 Thread HAKAN DEMIRTAS
Hi, Is there any R library that is capable of handling polygamma function (Hurwitz zeta function also works)? I am aware of digamma(0 and trigamma(), but could not find more advanced versions. I'd appreciate any help. Hakan Demirtas __ R-help@r-pr

Re: [R] log-normal overlay

2010-01-04 Thread Peter Ehlers
Hmm, I just answered this on R-devel where I forgot to say that this is certainly not an R-devel type of query. Please don't cross-post and don't abuse the R-devel list. -Peter Ehlers emorway wrote: Hello, Using the following lines of code, I created the following graph: d.resid<-c(-5.63,4.2

[R] Linear Discriminant Analysis in R

2010-01-04 Thread cobbler_squad
Dear R-gurus, Here is what I need to do.. I have two .txt files that are in a matrix form (each looks something like this: 0.0334820.02238 0.026677 0.0345530.0232260.028855 0.0350170.0232620.02941 0.0362620.023306

[R] ggplot2 = bar size

2010-01-04 Thread Leandro Marino
Hi, i am newbie into ggplot and i thow that i have to learn a lot about this package. I am doing this function to draw an graphic: library(ggplot2) posx <- theme_text(angle=45,hjust=1,face='bold',size=12) posy <- theme_text(angle=0,hjust=1,face='bold',size=12) y1 <- c(1,4,6,1,8,10,6,1,5,4) x <

[R] log-normal overlay

2010-01-04 Thread emorway
Hello, Using the following lines of code, I created the following graph: d.resid<-c(-5.63,4.25,4.38,3.05,-1.85,1.40,1.80,-0.80,4.20,3.20,-2.70,-7.20,-0.10,-2.50,0.60,1.20,1.30,1.20,1.30,1.27,6.91,8.55,7.18,8.73,1.82,-1.45,5.91,5.45,-0.82,-4.55,0.82,82.91,1.73,3.09,5.64,-1.73,-9.55,4.27,17.45,9.6

Re: [R] how to plot multiple density functions in one graph

2010-01-04 Thread David Winsemius
On Jan 4, 2010, at 3:13 PM, John Westbury wrote: Hello, I am new to R and have two easy questions. How can you plot multiple density functions in one graph? I have five beta densities that I would like to plot in one graph. I understand how to plot one beta density as a line: plot (x,

Re: [R] how to plot multiple density functions in one graph

2010-01-04 Thread John Kane
?lines ?points --- On Mon, 1/4/10, John Westbury wrote: > From: John Westbury > Subject: [R] how to plot multiple density functions in one graph > To: r-help@r-project.org > Received: Monday, January 4, 2010, 3:13 PM > Hello, > > I am new to R and have two easy questions. > > How can you p

[R] how to plot multiple density functions in one graph

2010-01-04 Thread John Westbury
Hello, I am new to R and have two easy questions. How can you plot multiple density functions in one graph? I have five beta densities that I would like to plot in one graph. I understand how to plot one beta density as a line: plot (x,(dbeta(x,shape1=,shape2=,), type ="l") Does the Pareto di

Re: [R] How to dynamically display title for a graph

2010-01-04 Thread Duncan Murdoch
On 04/01/2010 11:30 AM, noclue_ wrote: I have written a function (see below) which encloses a boxplot. My function "xbox" takes in a variable name (such as "age"), and do a boxplot. Now I would like to add a title for the graph dynamically displaying the variable name as part of title. But,

Re: [R] vectors into a matrix

2010-01-04 Thread Bert Gunter
This is one of those times where do.call() comes in very handy: first convert the vector names into a list using lapply and get() and then call do.call with cbind on the list: do.call(cbind,lapply(paste("VD",1:12,sep=""),get)) This also illustrates the virtue of putting such vectors in a list to

[R] How to dynamically display title for a graph

2010-01-04 Thread noclue_
I have written a function (see below) which encloses a boxplot. My function "xbox" takes in a variable name (such as "age"), and do a boxplot. Now I would like to add a title for the graph dynamically displaying the variable name as part of title. But, in reality, the title displays VALUES of

Re: [R] Extract vector elements until cumsum <= x

2010-01-04 Thread Dgnn
Thanks a lot, everybody! I've been working with these data for a while, and didn't realize that some of my assumptions lead me to leave out some important info. Specifically, that the vector contains time values of intervals between adjacent events, and so are always positive. Thanks again for y

Re: [R] glmer (lme4), glmmPQL (MASS) and xtmepoisson (Stata)

2010-01-04 Thread Ben Bolker
lshtm.ac.uk> writes: > I'm trying to specify a generalized linear mixed model in R, > basically a Poisson model to describe monthly > series of counts in different regions. > My aim is to fit subject-specific curves, > modelling a non-linear trend for each region through random > effects for l

Re: [R] xyplot - help with multiple Y's vs. X of a member data in multiple panels

2010-01-04 Thread Santosh
Hi Jim and others, I tried suggestions and somehow the graphs do not seem to be aligned on X-axis (i.e. they appear to be shifted on x-axis).. I guess panel.xyplot or panel.superpose is needed? I am not sure what the "group" variable be panel.xyplot, whether it is the "ID" or the "newFactor". I tr

Re: [R] lapack error on Redhat Linux Fedora 11

2010-01-04 Thread Patrick Connolly
On Thu, 24-Dec-2009 at 01:14PM -0800, Hongbin Zhang wrote: |> |> |> Hi, |> |> The following errors occurs when I run the nlme's example: |> |> -- |> Error in chol.default((value + t(value))/2) : |> lapack routines cannot be load

Re: [R] vectors into a matrix

2010-01-04 Thread Henrique Dallazuanna
Try this: cbind(ID = as.numeric(gsub("VD", "", ls(patt = "VD\\d+"))) , t(sapply(ls(patt = "VD\\d+"), get))) On Mon, Jan 4, 2010 at 3:32 PM, Victor Kyros wrote: > Dear all, > > I'm writing code to do automatically several > calculations and gather the results in a matrix. > > > I have the followi

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Gabor Grothendieck
Here is a variation which also uses head and tail: mapply(function(x, y) (x + y)/2, tail(x, -1), head(x, -1), SIMPLIFY = FALSE) On Mon, Jan 4, 2010 at 12:37 PM, Henrique Dallazuanna wrote: > For this example try this: > > lapply(lapply(list('head', 'tail'), do.call, list(x, n = -1)), > function

Re: [R] vectors into a matrix

2010-01-04 Thread David Winsemius
On Jan 4, 2010, at 1:13 PM, David Winsemius wrote: On Jan 4, 2010, at 12:32 PM, Victor Kyros wrote: Dear all, I'm writing code to do automatically several calculations and gather the results in a matrix. I have the following vectors and I just want to make a matrix with them: VD1 VD2 VD3

Re: [R] Adding a distance scale to a plot?

2010-01-04 Thread Walmes Zeviani
JustADude wrote: > > Do you know what steps I need to take to add a scale to a plot? > > I'm pulling my example out of "An Introduction to R: Software for > StatisticalModelling & Computing" (see the R code around Figure 76). > > > I would like to add a scale to the image produced by the fo

Re: [R] vectors into a matrix

2010-01-04 Thread David Winsemius
On Jan 4, 2010, at 12:32 PM, Victor Kyros wrote: Dear all, I'm writing code to do automatically several calculations and gather the results in a matrix. I have the following vectors and I just want to make a matrix with them: VD1 VD2 VD3 ... VD12 cbind( 1:12, matrix(c(VD1, ..., VD12), nr

[R] glmer (lme4), glmmPQL (MASS) and xtmepoisson (Stata)

2010-01-04 Thread Antonio.Gasparrini
Dear R users, I'm trying to specify a generalized linear mixed model in R, basically a Poisson model to describe monthly series of counts in different regions. My aim is to fit subject-specific curves, modelling a non-linear trend for each region through random effects for linear splines compon

[R] vectors into a matrix

2010-01-04 Thread Victor Kyros
Dear all, I'm writing code to do automatically several calculations and gather the results in a matrix. I have the following vectors and I just want to make a matrix with them: VD1 VD2 VD3 ... VD12 *In this case, this series of vectors stops there, in 12, but it could be a higher number or sma

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Henrique Dallazuanna
For this example try this: lapply(lapply(list('head', 'tail'), do.call, list(x, n = -1)), function(x)Reduce('+', x)/2) On Mon, Jan 4, 2010 at 1:54 PM, Muhammad Rahiz wrote: > Thanks Gabor, > > It works alright. But is there alternative ways to perform rollmean apart > from permutating the data?

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-04 Thread Peter Ehlers
Saji Ren wrote: Thank you,man. the problem solved. Plus. when I got the parameters of the data. And I used the "truehist(mydata)" to get a histogram of the data, How can I draw a line of the distribution of the estimated parameters in the histogram plot? for example: fitdistr(na.exclude(mydat

[R] Adding a distance scale to a plot?

2010-01-04 Thread Jason Rupert
Do you know what steps I need to take to add a scale to a plot? I'm pulling my example out of "An Introduction to R: Software for StatisticalModelling & Computing" (see the R code around Figure 76). I would like to add a scale to the image produced by the following code.  I would like to the

Re: [R] problem with number formation

2010-01-04 Thread Berend Hasselman
dvkirankumar wrote: > > Hi all, > this is kiran > I got one problem with formating a number > that is > > if I have a number like --->"2.33" > that one ihave to convert to -->"2.33000" > ?sprintf Example: a <- 2.33 sprintf("%.5f", a) Berend -- View this message in context: http:

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Gabor Grothendieck
This is due to the non-idempotent nature of apply. Instead of apply, you can use - aaply in the plyr package http://tolstoy.newcastle.edu.au/R/devel/06/06/5687.html - or the idempotent apply (iapply) posted here by Hadley Wickham: and in either case you won`t have to permute the result. O

Re: [R] R2HTML Report number format, or Better Way?

2010-01-04 Thread L.A.
Thanks, All Jim your solution works and I'm playing around with it trying to learn the "ins & outs" I'd still like to figure out how to get this to work in R2HTML. I think I worded my question wrong making it appear more difficult, so I'll Try again. Here is the data and code >Par<-9683 >sal<

Re: [R] Question on Reduce + rollmean

2010-01-04 Thread Muhammad Rahiz
Thanks Gabor, It works alright. But is there alternative ways to perform rollmean apart from permutating the data? Possibly combining the Reduce and rollmean functions? The easiest but traditional way is > (x[[1]]+x[[2]]) / 2 > (x[[2]]+x[[3]]) / 2 Muhammad Rahiz | Doctoral Student in Regi

Re: [R] How to uninstall R packages

2010-01-04 Thread Guo-Hao Huang
?remove.packages Guo-Hao Huang -- From: "wenjun zheng" Sent: Monday, January 04, 2010 11:20 PM To: Subject: [R] How to uninstall R packages Dear all, I am puzzled that how can i uninstall a R package

Re: [R] Plot graph

2010-01-04 Thread Sarah Goslee
The first one is one plot created with calls to lines() and to abline(). Yours is seven different plots. That should be enough to get you started. This looks like it might be homework - if so, any other questions should go to your instructor. If not, a reproducible example would be far more likely

[R] Plot graph

2010-01-04 Thread cirtey
Hi; I want to obtain this graphic. http://n4.nabble.com/file/n998283/plot.gif Instead whith my code : par(mfrow=c(1,7),mar=c(0,0,0,0)) plot(EntreesMoyennesMensuelles2003, type="l",main="2003",col="yellow") plot(EntreesMoyennesMensuelles2004, type="l",main="2004",col="red") plot(EntreesMoyennesMen

Re: [R] locator and print

2010-01-04 Thread Duncan Murdoch
On 04/01/2010 10:18 AM, Thomas Roth wrote: Hi, Using the following R-Code the printing via print takes place after locator although print is placed before locator ### test = function() { plot(1:10) print("test") locator(1) } test ### Is there some way to force the printing before locator is b

Re: [R] How to uninstall R packages

2010-01-04 Thread David Winsemius
On Jan 4, 2010, at 10:23 AM, Uwe Ligges wrote: On 04.01.2010 16:20, wenjun zheng wrote: Dear all, I am puzzled that how can i uninstall a R package that have been installed earlier (especially in MacOS). Any suggestion will be appreciated. ?remove.packages Or delete the folder in the

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Douglas Bates
On Mon, Jan 4, 2010 at 6:24 AM, Walmes Zeviani wrote: > AD Hayward wrote: >> >> Dear all, >> >> I'm attempting to use a piecewise regression to model the trajectory >> of reproductive traits with age in a longitudinal data set using a >> mixed model framework. The aim is to find three slopes and

Re: [R] How to uninstall R packages

2010-01-04 Thread Uwe Ligges
On 04.01.2010 16:20, wenjun zheng wrote: Dear all, I am puzzled that how can i uninstall a R package that have been installed earlier (especially in MacOS). Any suggestion will be appreciated. ?remove.packages Uwe Ligges __ R-help@r-project.org

[R] How to uninstall R packages

2010-01-04 Thread wenjun zheng
Dear all, I am puzzled that how can i uninstall a R package that have been installed earlier (especially in MacOS). Any suggestion will be appreciated. -- Wenjun [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] locator and print

2010-01-04 Thread Thomas Roth
Hi, Using the following R-Code the printing via print takes place after locator although print is placed before locator ### test = function() { plot(1:10) print("test") locator(1) } test ### Is there some way to force the printing before locator is being evaluated. I assume that there is some b

Re: [R] multivariate group means

2010-01-04 Thread Walmes Zeviani
Ondřej Mikula wrote: > > Hello, > I look for a simple command computing multivariate group means and > returning an object of class "matrix" rather than "list". Does any > such function exist in standard packages? > I'm beginning with R, so I'm sorry if the solution is trivial. > Ondra Mikula >

Re: [R] Interpreting coefficient in selection and outcome Heckman models in sampleSelection

2010-01-04 Thread Mark Bulling
Hi Ott The reason for calculating would be to add "context" to the OLS estimates (from the probit) - e.g. a 1 year increase in age might increase the dependent variable by 1 unit, but given that the selection model is based on a subset of the full data set, if the probability of reaching the selec

[R] problem with number formation

2010-01-04 Thread venkata kirankumar
Hi all, this is kiran I got one problem with formating a number that is if I have a number like --->"2.33" that one ihave to convert to -->"2.33000" and if I have a number like --->"0.33" that one ihave to convert to -->"0.33000" is this posible in R-project if its posible please

Re: [R] Interpreting coefficient in selection and outcome Heckman models in sampleSelection

2010-01-04 Thread Ott-Siim Toomet
Hi Mark, why do you need that? If your task is to estimate how much your y changes if x change, why not use simple OLS? (Well, right, you should be able to use sampleSelection as well). It shouldn't probably be hard to compute it -- it is just OLS marginal effect + som kind of derivative of Inve

[R] help, how self-oganizing map show 2D picture and put all samples into the picture?

2010-01-04 Thread bbslover
http://n4.nabble.com/file/n998182/pca.jpg pca.jpg http://n4.nabble.com/file/n998182/som.jpg som.jpg http://n4.nabble.com/file/n998182/all%2Bindepents.xls all+indepents.xls As we know, som is a good tool to cluster hign demension to 2D and show as a 2D picture, just like in the attachment pic

Re: [R] metafor: using mixed models

2010-01-04 Thread Viechtbauer Wolfgang (STAT)
Dear Joris, When you call rma() with the (default) argument "intercept=TRUE", then the intercept is added to the X matrix (a column of 1s is added). So, if you use: fac <- c(1,1,2,3,3,4,4,5,5,5) X <- model.matrix(~factor(fac))[,2:5] and then: rma(ai, bi, ci, di, mods=X, data=testdata, measure=

Re: [R] function in aggregate applied to specific columns only

2010-01-04 Thread Matthew Dowle
> That makes eight solutions. Any others? :) A ninth was detailed in two other threads last month. The first link compares to ave(). http://tolstoy.newcastle.edu.au/R/e8/help/09/12/9014.html http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8830.html "Dennis Murphy" wrote in message news:9a8a6c6

[R] Odp: multivariate group means

2010-01-04 Thread Petr PIKAL
Hi I did not see any answer to your question yet so I will try one. r-help-boun...@r-project.org napsal dne 30.12.2009 15:41:43: > Hello, > I look for a simple command computing multivariate group means and What is multivariate group mean? Do you mean means of some groups? In that case you cou

Re: [R] Help with function "fitdistr" in "MASS"

2010-01-04 Thread Saji Ren
Thank you,man. the problem solved. Plus. when I got the parameters of the data. And I used the "truehist(mydata)" to get a histogram of the data, How can I draw a line of the distribution of the estimated parameters in the histogram plot? for example: >fitdistr(na.exclude(mydata),"normal") m

Re: [R] Extract vector elements until cumsum <= x

2010-01-04 Thread Gabor Grothendieck
Try this which uses 10 as the check value: f <- function(acc, x) if (acc + x > 10) x else acc + x x <- c(4, 6, 2, 7, 4, 1, 4, 8) Reduce(f, x) On Sun, Jan 3, 2010 at 10:02 PM, Dgnn wrote: > > Hi All, > > I have a vector n, and for each n[i] I want to extract n[i], n[i+1], > n[i+2]..., until the

Re: [R] Are unpaired data suitable for DiagnosisMed's Diagnosis ?

2010-01-04 Thread Frank E Harrell Jr
elaine kuo wrote: Dear, I wanna to compare AUC generated by two distribution models using the same sample. The AUC for model 1 consists of two columns, column A for 0/1 and column B for probability, eahc with the same row number of 3000. The AUC for model 2 consists of two columns, column A fo

Re: [R] Are unpaired data suitable for Hmisc's improveProb ?

2010-01-04 Thread Frank E Harrell Jr
improveProb, as the documentation says, takes two predicted probabilities and one outcome variable as its inputs. The predictions must be on the same subjects so improveProb only handles paired data. Frank elaine kuo wrote: Dear, I wanna to compare AUC generated by two distribution models

Re: [R] no "rcorrp.cens" in hmisc package

2010-01-04 Thread Frank E Harrell Jr
You omitted library(Hmisc) or require(Hmisc) Frank elaine kuo wrote: Dear, I wanna to compare AUC generated by two distribution models using the same sample. I tried improveProb function's example code below. set.seed(1) library(survival) x1 <- rnorm(400) x2 <- x1 + rnorm(400) d.time <- rexp(

Re: [R] installation

2010-01-04 Thread Prof Brian Ripley
On Mon, 4 Jan 2010, Iasonas Lamprianou wrote: hi all, is there a cd-rom image with a full R pre-installation which I can give to my students so that if they want to run R on their computer, they will be able to run it from the cd-rom without having to install it on their computer. That way,

[R] Are unpaired data suitable for DiagnosisMed's Diagnosis ?

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. The AUC for model 1 consists of two columns, column A for 0/1 and column B for probability, eahc with the same row number of 3000. The AUC for model 2 consists of two columns, column A for 0/1 and column B f

[R] Are unpaired data suitable for Hmisc's improveProb ?

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. The AUC for model 1 consists of two columns, column A for 0/1 and column B for probability, eahc with the same row number of 3000. The AUC for model 2 consists of two columns, column A for 0/1 and column B f

[R] no "rcorrp.cens" in hmisc package

2010-01-04 Thread elaine kuo
Dear, I wanna to compare AUC generated by two distribution models using the same sample. I tried improveProb function's example code below. set.seed(1) library(survival) x1 <- rnorm(400) x2 <- x1 + rnorm(400) d.time <- rexp(400) + (x1 - min(x1)) cens <- runif(400,.5,2) death <- d.time <= cens d.

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Walmes Zeviani
AD Hayward wrote: > > Dear all, > > I'm attempting to use a piecewise regression to model the trajectory > of reproductive traits with age in a longitudinal data set using a > mixed model framework. The aim is to find three slopes and two points- > the slope from low performance in early

[R] BIOMOD: the format of background data

2010-01-04 Thread elaine kuo
Dear, I am a newbie to R. I am trying BIOMOD to simulate species distributions with presence-only data. As the presence-only data consist of three columns, presence, longitude, latitude, please kindly share how to prepare the background data (maybe using ArcGIS ?) Thank you Elaine [[

Re: [R] Boxplot- change the vertical line from dash to solid

2010-01-04 Thread elaine kuo
Dear Dieter, Thanks for the info. However, I did not know which document you refer to. Please kindly indicate the website or the source. Thank you Elaine On Mon, Jan 4, 2010 at 4:24 PM, Dieter Menne wrote: > > > > elaine kuo wrote: > > > > Now I am learning to draw boxplot using graphics(). I w

Re: [R] Piecewise regression in lmer

2010-01-04 Thread Dieter Menne
AD Hayward wrote: > > I'm attempting to use a piecewise regression to model the trajectory > of reproductive traits with age in a longitudinal data set using a > mixed model framework. > You might have a look a Alejandro Jara DPpackage which worked quite well for me in a similar case. Th

Re: [R] R2HTML Report number format, or Better Way?

2010-01-04 Thread Gregoire Pau
Hi L.A., Use the package 'hwriter' to produce HTML pages/objects. > library(hwriter) > hwrite(srtype, page="c:/R/reports/myreport1.html") 'hwrite' can be combined with the function 'format' (to manage number format, digits, decimal places, etc...) and supports advanced HTML/CSS formatting opt

Re: [R] spectrogram

2010-01-04 Thread Olivier Crouzet
Le Mon, 4 Jan 2010 14:17:44 +0530, rajesh j a écrit : > Hi, > I need to plot spectrogram of a waveform.What package offers this? > See the seewave package. on cran: http://cran.r-project.org/web/packages/seewave/index.html and on the package's website for online documentation: http://sueur.j

[R] metafor: using mixed models

2010-01-04 Thread Joris Meys
Dear all, I'm currently applying a mixed model approach to meta analysis using the package metafor. I use the "model.matrix()" function to create dummy variables. The option btt gives me the combined test for the dummies. Problem is, I don't know which indices I have to use, and can't really figur

Re: [R] Assistance with boot() Package

2010-01-04 Thread Adam Carr
Good Morning Prof. Ripley: Thanks very much for the help. I do have the Davison and Hinkley text but I continued to struggle with the proper syntax to make iteration work. The MASS package is already installed on my machine and I have the manual so I will check the example you mentioned. Thank

Re: [R] installation

2010-01-04 Thread Uwe Ligges
Iasonas Lamprianou wrote: hi all, is there a cd-rom image with a full R pre-installation which I can give to my students so that if they want to run R on their computer, they will be able to run it from the cd-rom without having to install it on their computer. That way, they can have a 'pr

Re: [R] Emacs vs Eclipse vs Rcmdr

2010-01-04 Thread Philippe Grosjean
Hello, You can probably add SciViews in the list. There are many, many interesting features in SciViews-K/Komodo for developing new user interfaces rapidly and easily. Unfortunately, there is no documentation yet, and thus, most of the functions remain "hidden" (but you can play with it and a

Re: [R] installation

2010-01-04 Thread Iasonas Lamprianou
hi all, is there a cd-rom image with a full R pre-installation which I can give to my students so that if they want to run R on their computer, they will be able to run it from the cd-rom without having to install it on their computer. That way, they can have a 'protable' R package installation

Re: [R] Extract vector elements until cumsum <= x

2010-01-04 Thread Dieter Menne
Dgnn wrote: > > I have a vector n, and for each n[i] I want to extract n[i], n[i+1], > n[i+2]..., until the cumulative sum of n[i] and subsequent elements > exceeds a CheckValue, whereupon I move to the next index and repeat. > > I am trying to find a Vectorized approach, and have seen simila

[R] Piecewise regression in lmer

2010-01-04 Thread AD Hayward
Dear all, I'm attempting to use a piecewise regression to model the trajectory of reproductive traits with age in a longitudinal data set using a mixed model framework. The aim is to find three slopes and two points- the slope from low performance in early age to a point of high performan

Re: [R] spectrogram

2010-01-04 Thread Dieter Menne
rajesh j wrote: > > I need to plot spectrogram of a waveform.What package offers this? > > Try "spectrogram" in r-help search. Dieter -- View this message in context: http://n4.nabble.com/spectrogram-tp998119p998146.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Interpreting coefficient in selection and outcome Heckman models in sampleSelection

2010-01-04 Thread Arne Henningsen
Hi Mark! On Sun, Jan 3, 2010 at 9:08 PM, Mark Bulling wrote: > Hi there > > Within sampleSelection, I'm trying to calculate the marginal effects for > variables that are present in both the selection and outcome models. > > For example, age might have a positive effect on probability of selection

Re: [R] plot question

2010-01-04 Thread Albert-Jan Roskam
Hi Dennis and Gabor,   Thanks a lot for the useful suggestions! Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess. ~~ --- On Sun,

  1   2   >