Re: [R] cut.dendrogram and cutree

2007-10-28 Thread Agustin Lobo
Yes, I was just trying unlist() in a similar way. All I need is to apply labels() and/or unlist() to each element of the list dend2$lower: lista <- vector("list", length(dend2$lower)) for (i in 1:length(dend2$lower)) { lista[[i]] <- labels(dend2$lower[[i]]) } lista Thanks! Agus

Re: [R] cut.dendrogram and cutree

2007-10-28 Thread Yaomin Xu
Agus, How about the following? > labels(dend2$lower[[1]]) [1] "Florida""North Carolina" > labels(dend2$lower[[2]]) [1] "California" "Maryland" "Arizona""New Mexico" "Delaware" "Alabama""Louisiana" [8] "Illinois" "New York" "Michigan" "N

Re: [R] Fwd: cut.dendrogram and cutree

2007-10-28 Thread Agustin Lobo
Thanks, But this is not solving my problem, let me further explain by following the example in the help page for dendrogram: require(graphics); require(utils) hc <- hclust(dist(USArrests), "ave") dend1 <- as.dendrogram(hc) dend2 <- cut(dend1, h=70) plot(dend2$upper,center=T) What I want to know

Re: [R] lm design matrix bug?

2007-10-28 Thread Tim Calkins
check the dimensions of your X and P matrices: >dim(X) [1] 21 9 >dim(P) [1] 9 21 what you see is that the final row is *named* 26. It's actually row 21. cheers, On 10/29/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi All > > Maybe I dont understand it, but I would have expected that the

[R] lm design matrix bug?

2007-10-28 Thread toby909
Hi All Maybe I dont understand it, but I would have expected that the design matrix has as many rows as there were observations available to fit the model. Below a small artificial dataset created, then one model fitted and the design matrix outputted, having 27 rows. Then I delete 6 obs, and f

[R] help please

2007-10-28 Thread osita k ezeh
hello, please can anyone help me out. Am a new user of R program. Am having problem with this code below, not getting the expected results. Each m, the cumulative sum should be 1.000 but the 2nd and 3rd m returned 2.000 and 3.000 instead of 1.000. thanks Aruike pp=function(x,n,M){z=1.0;a=2

Re: [R] flops calculation

2007-10-28 Thread jim holtman
You would want to use the "user" time since that indicates that amount of time it spends in the user application, which would be R. Take a look at the ratio between user and system; user should be much higher than system. If not, then this might indicate that you have a lot of I/O going on, or s

Re: [R] How to format data for time-series analysis

2007-10-28 Thread Gabor Grothendieck
Some information on the meaning of the fields would have been helpful but asuming that the fields are row number, dd-mm-yy date, Event, State (which may be empty) and Value, the following produces a list, L, of 3 zoo objects: Lines.raw <- "Time Event State Value 1 24-10-20 BMU 20 2 25

[R] flops calculation

2007-10-28 Thread kevinchang
Hi all, Since proc.time return three different kind of times (user, system and elapsed) , I am wondering which one is right for calculating flops. In New S Language (Becker et. al. ) , it seems to be the user because " the user time measures the processor time used in S and the system time measu

Re: [R] How to format data for time-series analysis

2007-10-28 Thread jim holtman
Just add the steps to do the conversion yourself. Also you data seems to be missing columns, at least in the mail you sent. Also the 'zoo' object will be a character matrix. > x <- read.table(tc <- textConnection(" Time Event State Value + 24-10-20 BMU 20 + 25-10-20 Image

Re: [R] multivariate Stochastic Volatility and GARCH

2007-10-28 Thread wssecn
For DCC (and others multivariate garch models) see Kevin Sheppad's UCSD GARCH Toolbox: http://www.kevinsheppard.com/wiki/UCSD_GARCH Hope this helps, Washington S. Silva > Dear everyone, > > i`m a german economics student, writing my master´s thesis about > "Multivariate Volatility Models".

[R] How to format data for time-series analysis

2007-10-28 Thread B. Bogart
Hey all again, So I'm going through tutorials and getting a better sense of R structures. So I made some mockup data to see if I can figure out how to load it properly. (attached) if anyone has any suggestions on a better way to structure that data please let me know. So the file has three colu

[R] problems in cross validation of SVM in pakage "e1071"

2007-10-28 Thread David Meyer
Dear Nan Qiao, the accuracies are in percent (so times 100). Best David Hi: I am a newer in using R for data mining, and find the "e1071" pakage an excellent tool in doing data mining work! what frustrated me recently is that when I using the function "svm" and usin

Re: [R] how to download pdb structure files?

2007-10-28 Thread Duncan Temple Lang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Just for the record ... Using external tools like wget, curl, etc. is very useful. If one needs an approach that relies on R or working with a subset of the files without transferring them all, or simply not dealing with the file system (for securi

[R] tree problem

2007-10-28 Thread Richard Valliant
I am trying to use tree to partition a data set. The data set has 3924 observations. Partitioning seems to work for small subsets of the data, but when I use the entire data set, no partitioning occurs. The variables are: RESPrespondent to a survey (0 = not a respondent, 1 = respondent)

Re: [R] cut.dendrogram and cutree

2007-10-28 Thread Yaomin Xu
Agus, we use cut.tree when it makes sense to use a specific h as a global criterion to split the tree. In your case, you might want to access the tree using '[['. Examples below borrow the samples you provided in your code: 1) There are two branches in your dend1. To get the left branch, you can

Re: [R] Package Installer Fails in OSX 10.5 Leopard

2007-10-28 Thread Don Kalar
Mark, Thanks for your suggestions - I was able to install R by running each of the individual packages that would be installed by R.mpkg, so it seems to be a trivial fix. I haven't tested R exhaustively yet, but the few scripts I've tried seem to run correctly. cheers, -d On 10/27/07, Mark Ward

[R] Request for help with nls error

2007-10-28 Thread Trena Phipps
Hi. I am attempting to run my code to get estimates for a nonlinear model. Unfortunately, when I run the code, I keep getting the following errors (they switch back and forth depending on when I run it): Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial p

Re: [R] how to download pdb structure files?

2007-10-28 Thread Ben Bolker
Gabor Csardi wrote: > > On Sun, Oct 28, 2007 at 11:25:06AM -0700, Ben Bolker wrote: >> >> > If you don't know then you might try to read the documentation. Then it > takes > about five seconds to get the right syntax: > > download.file("ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb/pdb

Re: [R] is there a similar function to perform repeated statements asin SAS PROC MIXED?

2007-10-28 Thread Douglas Bates
On 10/24/07, Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote: > you can wave a look at the gls() function in package nlme, and > specifically at the `weights' and `correlation' arguments; the same > arguments are also available in the lme() function. That is certainly a way of fitting a correlation

Re: [R] how to download pdb structure files?

2007-10-28 Thread Gabor Csardi
On Sun, Oct 28, 2007 at 11:25:06AM -0700, Ben Bolker wrote: > > > > Baoqiang Cao-2 wrote: > > > > Dear All, > > > > I'd like to know if there is anyway to download a certain structure file > > from http://www.pdb.org/. I tried the following but failed: > > > > tmp <- > > download.file(url="ft

[R] Attaching interactive plot to existing PDF file

2007-10-28 Thread Jonas Malmros
Dear list members, I create a pdf file with a number of barplots and histograms: pdf(file=my.pdf.file, paper="a4", width=6, height=10) ... dev.off() Then I run a model and plot fitted vs residuals and interactively (using identify()) label some of the residuals on that plot. After that I want to

Re: [R] how to download pdb structure files?

2007-10-28 Thread Ben Bolker
Baoqiang Cao-2 wrote: > > Dear All, > > I'd like to know if there is anyway to download a certain structure file > from http://www.pdb.org/. I tried the following but failed: > > tmp <- > download.file(url="ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb";, > destfile="pdb100d.ent.gz") >

Re: [R] help

2007-10-28 Thread Ben Bolker
osita k ezeh wrote: > > hello, > > please can anyone help me out. Am a new user of R > program. Am having problem > with this code below, not getting the expected > results. > > I wrote a function that replicates your results and would probably be a little more efficient (see Uwe's rep

[R] Help for Beginner

2007-10-28 Thread Leandre Bassole
Hi all I am a new user of R. I am very familar to Stata, but few days ago I have decided to switch to R. But R langage is very difficult.I really want to know the best way to learn this famous and interesting software. Best regards Léandre BASSOLE PhD Student CNRS-CERDI 65 Bd Francois Mitte

[R] how to download pdb structure files?

2007-10-28 Thread bqcaomail
Dear All, I'd like to know if there is anyway to download a certain structure file from http://www.pdb.org/. I tried the following but failed: tmp <- download.file(url="ftp://ftp.wwpdb.org/pub/pdb/data/structures/all/pdb";, destfile="pdb100d.ent.gz") trying URL 'ftp://ftp.wwpdb.org/pub/pdb/dat

Re: [R] Help for Beginner!!

2007-10-28 Thread Gabor Grothendieck
Google for CRAN contributed documentation and the first link google gives will get you to about 2 dozen freely downloadable introductions which you can choose from while the second link google gives you is to the R manuals Also google for Wikipedia R Programming Language and check out the Exte

Re: [R] Help for Beginner!!

2007-10-28 Thread Liviu Andronic
On 10/28/07, Leandre Bassole <[EMAIL PROTECTED]> wrote: > I am a new user of R. I am very familar to Stata, but few days ago I have > decided to switch to R. But R langage is very difficult.I really want to > know the best way to learn this famous and interesting software. The following two

Re: [R] Help for Beginner!!

2007-10-28 Thread John Kane
At an utterly basic level, a tutorial like http://www.math.ilstu.edu/dhkim/Rstuff/Rtutor.html is very useful. --- Leandre Bassole <[EMAIL PROTECTED]> wrote: > > L�andre BASSOLE > PhD Student > CNRS-CERDI > 65 Bd Francois Mitterrand > Boite Postale 320 > 63009 Clermont-Ferrand CEDEX 1 > FRANC

Re: [R] working with loops; was: help

2007-10-28 Thread Uwe Ligges
Please read the posting guide: 1. use a sensible subject line 2. please read the docs prior to posting messages. Some basic rule is, e.g., to initialize objects to their final lengths before entering loops. osita k ezeh wrote: > hello, > > please can anyone help me out. Am a new user of R > p

Re: [R] maximizing a function

2007-10-28 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: > Hi list, > I would like to maximize a likelihood function to obtain estimates. The > problem is that i first have to have functions other functions that are in > the likelihood that depend on the parameters. I was thinking of using optim > but i do not know how to go

Re: [R] calculating correlation of a Supply/Demand measure and price change (in high frequency time series data)

2007-10-28 Thread A.R. Criswell
Wow... Some people can really be high frequency snobs! __ R-help@r-project.org 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-con

Re: [R] calculating correlation of a Supply/Demand measure and price change (in high frequency time series data)

2007-10-28 Thread Uwe Ligges
Kenneth Spriggs wrote: > Regarding "financial" data: I have a high frequency (1 minute) I never understand people from economics, that 1 minute *high* frequency sampling is roughly 250 times less frequent than things I am analyzing. ;-) > measure of > supply/demand and I'd like to know

Re: [R] Comparing lagged time series

2007-10-28 Thread Uwe Ligges
Please specify a reproducible example and tell us your version of R and your OS (as the posting guide asks you to do!), the following works for me: lag(lh, -2) Uwe Ligges j taecha wrote: > As a newbie to R I have the following question. I would like to compare > values in a time series with va

Re: [R] Help for Beginner!!

2007-10-28 Thread Uwe Ligges
Start with reading the manual "An Introduction to R". There is quite a lot of literature mentioned under "Documentation" on the left hand side of http://www.r-project.org. Uwe Ligges Leandre Bassole wrote: > Léandre BASSOLE > PhD Student > CNRS-CERDI > 65 Bd Francois Mitterrand > Boite Postale

Re: [R] X11 graphics windows under CMD BATCH

2007-10-28 Thread Dirk Eddelbuettel
Hi Luke, On 28 October 2007 at 14:30, Luke Spadavecchia wrote: | Hi Dirk, | | Thanks for your useful advice, although I am not sure I fully | understand your response. | | I am able to open x11 windows from R CMD BATCH both in windows | XP,MAC OS X and Linux (on various machines I use), pr

Re: [R] X11 graphics windows under CMD BATCH

2007-10-28 Thread Luke Spadavecchia
Hi Dirk, Thanks for your useful advice, although I am not sure I fully understand your response. I am able to open x11 windows from R CMD BATCH both in windows XP,MAC OS X and Linux (on various machines I use), providing the relevant Sys.setenv() commands are in the script I call prior to

[R] Help for Beginner!!

2007-10-28 Thread Leandre Bassole
Léandre BASSOLE PhD Student CNRS-CERDI 65 Bd Francois Mitterrand Boite Postale 320 63009 Clermont-Ferrand CEDEX 1 FRANCE Tel : +33 4 73 17 74 45 Fax : +33 4 73 17 74 28 - Forwarded Message From: Leandre Bassole <[EMAIL PROTECTED]> To: r-help@r-project.org Sent: Saturday, 27 October, 2007

Re: [R] plot for binomial glm

2007-10-28 Thread Ben Bolker
Radek John wrote: > > Hello everybody! > I am trying to plot glm with family=binomial and can`t work it out. My > Data > are: > > mort = data.frame(temp=c(32,32,32,37,37,37,42,42,42,47,47,47,52,52,52), num = c( 7,8,8,15,15,17,11,28,15,10,12,13,18,19,22), numdead = c(0,0,0,3,1,3,8,14,12,10,

Re: [R] plot for binomial glm

2007-10-28 Thread Sundar Dorai-Raj
Radek John said the following on 10/28/2007 5:53 AM: > Hello everybody! > I am trying to plot glm with family=binomial and can`t work it out. My Data > are: >> mort >temp num numdead > 132 7 0 > 232 8 0 > 332 8 0 > 437 15 3 > 537 15 1

[R] Standard errors of sample autocorrelations

2007-10-28 Thread Strong
Dear All Is there a way to extract the standard errors of sample autocorrelations after using acf function to estimate the autocorrelations. If yes, what method is the calculation of standard errors based on? Thanks in advance for your time and help. Strong ___

[R] plot for binomial glm

2007-10-28 Thread Radek John
Hello everybody! I am trying to plot glm with family=binomial and can`t work it out. My Data are: > mort temp num numdead 132 7 0 232 8 0 332 8 0 437 15 3 537 15 1 637 17 3 742 11 8 842 28 14 942 15

Re: [R] ploting labels on barplot

2007-10-28 Thread Jim Lemon
Bernd Jagla wrote: > Again me. > > > > I want to plot the numbers on the bars of a barplot. > > This can be done using hist function when setting the label argument true > (i.e. > > > > data <- c(1,2,3,4) > > hist(data, labels=T) > > > > When I try this using barplot I get an error

[R] gam for longitudinal data?

2007-10-28 Thread gallon li
I used gam for data analysis a lot. Is it possible to use gam to analyze longitudinal data? I mean, besides the working independence assumption, can i specify other more reasonable covariance structure in gam? [[alternative HTML version deleted]] __

[R] maximizing a function

2007-10-28 Thread Nigel . Walker
Hi list, I would like to maximize a likelihood function to obtain estimates. The problem is that i first have to have functions other functions that are in the likelihood that depend on the parameters. I was thinking of using optim but i do not know how to go about starting. A example of what i