[R] Question about 'lables' ect.

2006-03-15 Thread jia ding
Hi, I have a file named: test_R.txt aaa 2 bbb 5 ccc 7 sss 3 xxx 8 I want to have a plot: test-read.table(test_R.txt,col.name=c(Name,Score)) par(mfrow=c(1,2)) barplot(test$Score) name-test$Name axis(1,at=1:length(test$Name),labels=paste(name)) Q1, if you try the script above,you will get 5

Re: [R] Question about 'lables' ect.

2006-03-15 Thread Liaw, Andy
Try something like: xp - barplot(test$Score, space=.5) axis(1, at=xp, labels=as.character(test$Name)) See ?barplot more more detail. Andy From: jia ding Hi, I have a file named: test_R.txt aaa 2 bbb 5 ccc 7 sss 3 xxx 8 I want to have a plot:

Re: [R] Question about 'lables' ect.

2006-03-15 Thread Marc Schwartz (via MN)
On Wed, 2006-03-15 at 17:54 +0100, jia ding wrote: Hi, I have a file named: test_R.txt aaa 2 bbb 5 ccc 7 sss 3 xxx 8 I want to have a plot: test-read.table(test_R.txt,col.name=c(Name,Score)) par(mfrow=c(1,2)) It's not clear what the purpose is here, at least in this example.

Re: [R] question about lmer--different answers from different versions of R?

2006-03-01 Thread Spencer Graves
as the version of R. Question: Have you tried using method=Laplace or AGQ? The function lmer actually has three approximate maximum likelihood methods. The default is penalized quasi-likelihood (PQL), which is what you get when you don't specify a method or when you request method=ML

Re: [R] Question about Sweave

2006-02-28 Thread Friedrich . Leisch
On Mon, 27 Feb 2006 11:34:00 -0800, Elizabeth Purdom (EP) wrote: Hi, I'm not sure if Sweave questions should go to the general list, but it seems to be part of the core R package without a separate maintainer. I am writing a tutorial for R in a latex file. I'd like to use Sweave,

Re: [R] question about Principal Component Analysis in R?

2006-02-28 Thread Bjørn-Helge Mevik
Michael wrote: pca=prcomp(training_data, center=TRUE, scale=FALSE, retx=TRUE); Then I want to rotate the test data set using the d1=scale(test_data, center=TRUE, scale=FALSE) %*% pca$rotation; d2=predict(pca, test_data, center=TRUE, scale=FALSE); these two values are different

[R] question about Principal Component Analysis in R?

2006-02-27 Thread Michael
Hi all, I am wondering in R, suppose I did the principal component analysis on training data set and obtain the rotation matrix, via: pca=prcomp(training_data, center=TRUE, scale=FALSE, retx=TRUE); Then I want to rotate the test data set using the d1=scale(test_data, center=TRUE,

[R] question about lmer--different answers from different versions of R?

2006-02-27 Thread Feldman, Tracy
To whom it may concern: I am using lmer for a statistical model that includes non-normally distributed data and random effects. I used this same function in the most recent version of R as of fall 2005, and have re-done some of the same analyses using all of the same files, but with the

[R] Question about Sweave

2006-02-27 Thread Elizabeth Purdom
Hi, I'm not sure if Sweave questions should go to the general list, but it seems to be part of the core R package without a separate maintainer. I am writing a tutorial for R in a latex file. I'd like to use Sweave, since this seems its ideal usage. The problem is that I want to purposefully

Re: [R] Question about Sweave

2006-02-27 Thread Roger Bivand
On Mon, 27 Feb 2006, Elizabeth Purdom wrote: Hi, I'm not sure if Sweave questions should go to the general list, but it seems to be part of the core R package without a separate maintainer. I am writing a tutorial for R in a latex file. I'd like to use Sweave, since this seems its

Re: [R] Question about variable selection

2006-02-18 Thread Wensui Liu
://socserv.mcmaster.ca/jfox -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wensui Liu Sent: Saturday, February 18, 2006 2:03 PM To: Liaw, Andy Cc: r-help@stat.math.ethz.ch Subject: Re: [R] Question about variable

[R] question about the results given by the Box.test?

2006-02-15 Thread oliver wee
Hello, I am using the Ljung Box test in R to compute if the resiudals of my fitted model is random or not. I am not sure though what the results mean, I have looked at various sources on the internet and have come up with contrasting explanations (mainly because these info deal with different

Re: [R] question about the results given by the Box.test?

2006-02-15 Thread Patrick Burns
Hopefully the test is the same no matter what software you are using. A small p-value is an indication that there is structure in the data. So in your case there is no indication of autocorrelation up to lag 5, but it appears that there might be something going on at around lags 6 to 9. How

[R] question about plotting survfit object on log-log scale

2006-02-14 Thread singyee ling
Dear all, I tried to plot cumulative hazard H(t) against t on a log-log sclale by putting the optional function fun ='cloglog' in the plot function. However, I came across the following error message survcs20fit2-survfit(Surv(start,end,status)~sx,data=ALLDPcs20) plot(survcs20fit2,fun=cloglog)

[R] Question on big JPG plots in function warpping format

2006-02-10 Thread alexfang
Hello: I have problems generating big JPG plots in functions. the following code runs fine in the script: runs fine in script, generate 40k test1.jpg in the given directory plotPlatesAlong - c(1:5) plotDirPath - paste(dataPath, OutputPlots\\, sep=) filename -

Re: [R] Question on big JPG plots in function warpping format

2006-02-10 Thread Prof Brian Ripley
Most likely this is FAQ 7.22. althogh how we are supposed to know what plotHeatTrellis does is beyond me. On Fri, 10 Feb 2006, [EMAIL PROTECTED] wrote: Hello: I have problems generating big JPG plots in functions. the following code runs fine in the script: runs fine in script,

Re: [R] Question on big JPG plots in function warpping format

2006-02-10 Thread Alex
thanks, it works. best, Alex On Fri, 10 Feb 2006, Prof Brian Ripley wrote: Most likely this is FAQ 7.22. althogh how we are supposed to know what plotHeatTrellis does is beyond me. On Fri, 10 Feb 2006, [EMAIL PROTECTED] wrote: Hello: I have problems generating big JPG

[R] question about binary data file and data.frame

2006-02-07 Thread [EMAIL PROTECTED]
I have a binary file with data sequence in the order [age,weight][age,weight] I know the length of the data and I want to load it into a data.frame. of course a way to do this is to read age and weight seperately and then use cbin(age,weight) to combine them into a dataframe, but is

Re: [R] question about binary data file and data.frame

2006-02-07 Thread Barry Rowlingson
[EMAIL PROTECTED] wrote: I have a binary file with data sequence in the order What do you mean by 'binary file'? [age,weight][age,weight] How are age and weight encoded in this 'binary file'? I know the length of the data and I want to load it into a data.frame. of course a way to

Re: [R] question about binary data file and data.frame

2006-02-07 Thread [EMAIL PROTECTED]
Each data (edge,weight) is numerical data with type double (4 bytes) df-file(d:/sim.data,rb) age[1]-readBin(df,double()) weigt[1]-readBin(df,double()) ... age[10]-readBin(df,double()) weigt[10]-readBin(df,double()) it is not asc file. === 2006-02-07 13:03:17 === [EMAIL

Re: [R] question about binary data file and data.frame

2006-02-07 Thread jim holtman
Read it into a vector and then convert into a matrix; convert to a data frame: df - readBin(d:/sim.data, what='double', n=1, size=4) # make n greater than file size dim(df) - c(2, length(df) / 2) df - t(df) colnames(df) - c('age', 'weight') df - as.data.frame(df) On 2/7/06, [EMAIL

[R] question about corStruct

2006-02-06 Thread Ing. Marek Brabec PhD
dear list, I am wondering if one can find examples and/or more detailed descriptions of modifications needed when going beyond standard corStruct classes (i.e. those already provided for use in lme/nlme)? When I looked at pages 238-239 of Pinheiro/Bates (2000): Mixed-effects models in S and

Re: [R] question about corStruct

2006-02-06 Thread Peter Dalgaard
Ing. Marek Brabec PhD [EMAIL PROTECTED] writes: dear list, I am wondering if one can find examples and/or more detailed descriptions of modifications needed when going beyond standard corStruct classes (i.e. those already provided for use in lme/nlme)? When I looked at pages 238-239 of

[R] question

2006-02-03 Thread Xiao Zhao
Hello, I am a research student and I am using R to access my research. I want to know how to multiple plot , such as for the exponetial distribution, if I give the covariate different value, how to plot these in the same figure, And also I want to add the density plot in the histogramm. How to do

Re: [R] question

2006-02-03 Thread Gabor Csardi
x - seq(0, 10, by=.1) plot(x,pexp(x, rate=1)) points(x,pexp(x, rate=2), pch=2, col=blue) See help(plot), help(points), help(lines). Gabor On Fri, Feb 03, 2006 at 01:07:30PM -, Xiao Zhao wrote: Hello, I am a research student and I am using R to access my research. I want to know how to

Re: [R] Question about Aggregate

2006-01-29 Thread Spencer Graves
Did you try 'RSiteSearch(aggregate time series)'? When I did this just now, the third hit was, http://finzi.psych.upenn.edu/R/Rhelp02a/archive/55761.html;, which might help you. See in particular the zoo package and vignette, and especially the aggregate.zoo function, including the

[R] question about density estimation with monotonic constraints

2006-01-26 Thread Debayan Datta
Hi, I have a 1-d vector x of values but it is rather noisy. I know a priori that the density function should be monotonically decreasing, but my data doesnt have that. Is there a way to transform the data in such a way so that the resultant density be monotonically decreasing? Thanks Debayan

[R] question about system command

2006-01-25 Thread Taka Matzmoto
Hi R Users I am going to write a very short script for my small pilot simulation study. I need to call a DOS program with different input data files in the middle of for loop. There are 100 input data files (e.g., input001.dat, input002.dat, , input100.dat) for (1 in i :100) {

Re: [R] question about system command

2006-01-25 Thread Austin, Matt
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Taka Matzmoto Sent: Wednesday, January 25, 2006 9:31 PM To: r-help@stat.math.ethz.ch Subject: [R] question about system command Hi R Users I am going to write a very short script for my small pilot simulation study. I need to call a DOS program

Re: [R] question about system command

2006-01-25 Thread Prof Brian Ripley
] [mailto:[EMAIL PROTECTED] Behalf Of Taka Matzmoto Sent: Wednesday, January 25, 2006 9:31 PM To: r-help@stat.math.ethz.ch Subject: [R] question about system command Hi R Users I am going to write a very short script for my small pilot simulation study. I need to call a DOS program with different

[R] Question about Aggregate

2006-01-25 Thread Matthieu Cornec
hello, Suppose you a monthly series you want to aggregate at a quaterly frequency with the start and the end of your series in the middle of the quarter. For example 2001M2 2001M3 2001M4 2001M5 2001M6 2001M7 12 13 12 14 16 15 how can you get

Re: [R] Question about Aggregate

2006-01-25 Thread Gabor Grothendieck
Try this: library(zoo) z - zooreg(c(12, 13, 12, 14, 16, 15), start = c(2001, 2), freq = 12) aggregate(z, trunc(4 * time(z))/4, mean) 2001(1) 2001(2) 2001(3) 12.514.015.0 On 1/25/06, Matthieu Cornec [EMAIL PROTECTED] wrote: hello, Suppose you a monthly series you want to

[R] Question about fitting power

2006-01-25 Thread Ana Quitério
Hi R users I'm trying to fit a model y=ax^b. I know if I made ln(y)=ln(a)+bln(x) this is a linear regression. But I obtain differente results with nls() and lm() My commands are: nls(CV ~a*Est^b, data=limiares, start =list(a=100,b=0), trace = TRUE) for nonlinear regression

Re: [R] Question about fitting power

2006-01-25 Thread Liaw, Andy
The two methods are fitting different models. With lm(), the model is y = a * x^b * error or, equivalently, ln(y) = ln(a) + b * ln(x) + ln(error) With nls(), the model is y = a * x^b + error Thus you will get two different estimates. Andy From: Ana Quitério Hi R users I'm

Re: [R] Question about fitting power

2006-01-25 Thread Ruben Roa
-Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] On Behalf Of Ana Quitério Sent: Wednesday, January 25, 2006 3:33 PM To: r-help@stat.math.ethz.ch Subject: [R] Question about fitting power From: Ana Quitério Hi R users I'm trying to fit a model y

[R] I think simple R question

2006-01-12 Thread Mark Leeds
I have a vector x with #'s ( 1 or -1 in them ) in it and I want to mark a new vector with the sign of the value of the a streak of H where H = some number ( at the next spot in the vector ) So, say H was equal to 3 and I had a vector of [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 1

Re: [R] I think simple R question

2006-01-12 Thread roger koenker
see ?rle url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678Champaign, IL 61820 On Jan 12, 2006, at 9:56 AM, Mark Leeds wrote:

[R] question for mshapiro test

2006-01-11 Thread liuliang
Hi, I have a question about the p-value of mshapiro test. I simulated data from bivariate normal 1000 times and used mshapiro test to see how many times the test would reject the null hypothesis when the p-value is 0.05. The answer should be around 50 since the p-value is 0.05. But I got a much

[R] Question about plotting a hclust tree

2006-01-10 Thread Vincent Deng
Dear R-helpers, While plotting a hclust tree, is it possible to mark group information on it? Suppose I have a hclust tree ClusTree, and I use cutree to cut the tree into different groups as following a=cutree(ClusTree,h=10) How do I mark the grouping info stored in a while I plot ClusTree?

Re: [R] Question about graphics in R

2006-01-08 Thread Jim Lemon
Martin Erwig wrote: Considering the R function/plot shown below, I wonder whether it is possible to do the following changes: (1) Change the color of each point to be picked from list of colors according to its z-value. (The range should be from blue (z=0) to red (z=1).) The grid should

[R] Question about graphics in R

2006-01-07 Thread Martin Erwig
Considering the R function/plot shown below, I wonder whether it is possible to do the following changes: (1) Change the color of each point to be picked from list of colors according to its z-value. (The range should be from blue (z=0) to red (z=1).) The grid should then be omitted. [I have seen

Re: [R] Question about graphics in R

2006-01-07 Thread Duncan Murdoch
On 1/7/2006 12:47 PM, Martin Erwig wrote: Considering the R function/plot shown below, I wonder whether it is possible to do the following changes: (1) Change the color of each point to be picked from list of colors according to its z-value. (The range should be from blue (z=0) to red

Re: [R] newbie R question

2006-01-04 Thread justin bem
Why said stupid question ? be positive next time Best wishes. Peter Dalgaard [EMAIL PROTECTED] a écrit : Mark Leeds writes: I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from

[R] newbie R question

2006-01-03 Thread Mark Leeds
I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from the R site so that you can just do library(name_of_package) and it will work. I've looked at help etc but I can't find a command like

Re: [R] newbie R question

2006-01-03 Thread Peter Dalgaard
Mark Leeds [EMAIL PROTECTED] writes: I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from the R site so that you can just do library(name_of_package) and it will work. I've

Re: [R] newbie R question

2006-01-03 Thread Eric Kort
On Tue, 2006-01-03 at 16:07 -0500, Mark Leeds wrote: I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from the R site so that you can just do library(name_of_package) and it will work.

Re: [R] newbie R question

2006-01-03 Thread Roger Bivand
On Tue, 3 Jan 2006, Mark Leeds wrote: I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from the R site so that you can just do library(name_of_package) and it will work. I've

Re: [R] newbie R question

2006-01-03 Thread Prof Brian Ripley
On Tue, 3 Jan 2006, Mark Leeds wrote: I'm sorry to bother everyone with a stupid question but, when I am at an R prompt in Windows, is there a way to see what packages you already have installed from the R site so that you can just do library(name_of_package) and it will work. I've looked

Re: [R] newbie R question

2006-01-03 Thread Mark Leeds
in R by everyone. Truly amazing. You should all be quite proud about what you have created. Mark -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 03, 2006 4:16 PM To: Mark Leeds Cc: R-Stat Help Subject: Re: [R] newbie R question

[R] question on write.table

2005-12-15 Thread Weiwei Shi
Hi, I have a question on write.table: I have a data.frame called t7 as below: dim(t7) [1] 140151846 t7[1:5,] uci uce par line graphical.forms stems 1 0 0 00 active activ 2 0 0 00 policy polici 3 0 0 00 wc PC 4 0 0

Re: [R] question on write.table

2005-12-15 Thread Peter Dalgaard
Weiwei Shi [EMAIL PROTECTED] writes: Hi, I have a question on write.table: I have a data.frame called t7 as below: dim(t7) [1] 140151846 t7[1:5,] uci uce par line graphical.forms stems 1 0 0 00 active activ 2 0 0 00 policy polici 3

Re: [R] question on write.table

2005-12-15 Thread Prof Brian Ripley
Note that write.table is very much faster in current versions of R. So you could save the object, read it into 2.2.1 (beta) and write it out there. On Thu, 15 Dec 2005, Weiwei Shi wrote: Hi, I have a question on write.table: I have a data.frame called t7 as below: dim(t7) [1] 14015184

[R] Question

2005-12-13 Thread Davia Cox
Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the following code: set.seed(100) sample(0:9, 16, replace =TRUE)

Re: [R] Question

2005-12-13 Thread Davia Cox
Please disregard this message and don't post it to the web. I found the answer. Thanks Davia S. Cox 517-575-8031 cell [EMAIL PROTECTED] Human potential, though not always apparent, is there waiting to be discovered and invited forth. -William W. Purkey On Dec 13, 2005, at 6:20 AM, Davia

Re: [R] Question

2005-12-13 Thread Sean Davis
On 12/13/05 6:20 AM, Davia Cox [EMAIL PROTECTED] wrote: Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the

Re: [R] Question

2005-12-13 Thread Uwe Ligges
Davia Cox wrote: Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the following code: set.seed(100)

Re: [R] Question

2005-12-13 Thread Ted Harding
On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux (and probably most Unix) systems, /dev/random must be a pretty good approximation

Re: [R] Question

2005-12-13 Thread Prof Brian Ripley
On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux (and probably most Unix) systems,

Re: [R] Question

2005-12-13 Thread Ted Harding
On 13-Dec-05 Prof Brian Ripley wrote: On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux

[R] question about date's

2005-12-12 Thread Richard van Wingerden
Hi, Given a frame with calendar date's: 2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05,etc. I want to extract the following from these dates: week number month number year number Any ideas how to accomplish this? Many thanks. Regards, Richard

Re: [R] question about date's

2005-12-12 Thread ronggui
This is one way to do it. x-c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05) x [1] 2005-07-01 2005-07-02 2005-07-03 2005-07-04 2005-07-05 substr(x,1,4) [1] 2005 2005 2005 2005 2005 substr(x,6,7) [1] 07 07 07 07 07 substr(x,9,10) [1] 01 02 03 04 05 === 2005-12-12 20:06:00

Re: [R] question about date's

2005-12-12 Thread Jacques VESLOT
do.call(rbind, strsplit(as.character(date.vector), -)) Richard van Wingerden a écrit : Hi, Given a frame with calendar date's: 2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05,etc. I want to extract the following from these dates: week number month number year number Any ideas how

Re: [R] question about date's

2005-12-12 Thread ronggui
x-as.Date(c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05)) weekdays(x) [1] 星期五 星期六 星期日 星期一 星期二 months(x) [1] 七月 七月 七月 七月 七月 === 2005-12-12 20:17:38 您在来信中写道:=== Thanks! That solves my problem for year numbers and month numbers Any idea how to do this for week numbers?

Re: [R] question about date's

2005-12-12 Thread Prof Brian Ripley
On Mon, 12 Dec 2005, ronggui wrote: x-as.Date(c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05)) weekdays(x) [1] ÐÇÆÚÎå ÐÇÆÚÁù ÐÇÆÚÈÕ ÐÇÆÚÒ» ÐÇÆÚ¶þ months(x) [1] ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ He asked for week numbers. That's nothing like as easy, as it is not well-defined. But

Re: [R] question about date's

2005-12-12 Thread Richard van Wingerden
this is what I was looking for! many many thanks! regards, richard On 12/12/05, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Mon, 12 Dec 2005, ronggui wrote: x-as.Date(c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05)) weekdays(x) [1] 星期五 星期六 星期日 星期一 星期二 months(x) [1]

Re: [R] question about date's

2005-12-12 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: On Mon, 12 Dec 2005, ronggui wrote: x-as.Date(c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05)) weekdays(x) [1] ÐÇÆÚÎå ÐÇÆÚÁù ÐÇÆÚÈÕ ÐÇÆÚÒ» ÐÇÆÚ¶þ months(x) [1] ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ He asked for week numbers. That's

Re: [R] question about date's

2005-12-12 Thread Prof Brian Ripley
On Mon, 12 Dec 2005, Peter Dalgaard wrote: Prof Brian Ripley [EMAIL PROTECTED] writes: On Mon, 12 Dec 2005, ronggui wrote: x-as.Date(c(2005-07-01, 2005-07-02,2005-07-03,2005-07-04,2005-07-05)) weekdays(x) [1] ÐÇÆÚÎå ÐÇÆÚÁù ÐÇÆÚÈÕ ÐÇÆÚÒ» ÐÇÆÚ¶þ months(x) [1] ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ ÆßÔÂ

Re: [R] question about date's

2005-12-12 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: %W seems to be what is known as ISO dates (week starts on Monday), except that strftime(as.POSIXlt(as.Date(2005-01-01)), %U) [1] 00 should be week 53, 2004 according to my printed calendar, and emacs calendar-mode too. I _did_ say

Re: [R] Question on KalmanSmooth

2005-12-01 Thread Spencer Graves
You asked about the behavior of KalmanSmooth(...)$var with missing values. I also got very counterintuitive results from your excellent, reproducible example using R 2.2.0 under Windows XP: * With no missing values, KalmanSmooth(...)$var = 2, independent of the data and

[R] Question on KalmanSmooth

2005-11-28 Thread Kjetil Brinchmann Halvorsen
I am trying to use KalmanSmooth to smooth a time series fitted by arima (and with missing values), but the $smooth component of the output baffles me. Look at the following example: testts - arima.sim(list(ar=0.9),n=100) testts[6:14] - NA testmod - arima(testts, c(1,0,0)) testsmooth -

Re: [R] r question

2005-11-27 Thread Uwe Ligges
Please, 1. read the posting guide 2. use a sensible subject line 3. this is NOT an r question 4. ask your teacher to explain your homeworks, but not this list Uwe Ligges yuying shi wrote: If there are two random variable X1 and X2 which have a bivariate normal distribution with mean vector

Re: [R] r question

2005-11-27 Thread Peter Dalgaard
Uwe Ligges [EMAIL PROTECTED] writes: Please, 1. read the posting guide 2. use a sensible subject line 3. this is NOT an r question 4. ask your teacher to explain your homeworks, but not this list Uwe Ligges And, btw, neither the mean nor the variance exists, so the question

[R] r question

2005-11-26 Thread yuying shi
If there are two random variable X1 and X2 which have a bivariate normal distribution with mean vector (10, 10)and variance covariance matrix [21.95 1.953] How to calculate the mean and variance of the function Y=X1/X2? Thanks a lot! xingyu

[R] question on RPART

2005-11-21 Thread melina cappelli
Dera all, a simple question on rpart: when I run rpart on some data sets, I do not always get the surrogate splits at the root node. This does not depend on the presence of missing data because none of my data sets contains any, nevertheless sometimes i get them sometimes no, I wonder why!

Re: [R] question about R graphics-example plot attached

2005-11-19 Thread Mathieu Basille
Does 'rug' help you ? example(rug) ?rug Cheers Mathieu. jia ding a écrit : -- Forwarded message -- From: jia ding [EMAIL PROTECTED] Date: Nov 2, 2005 4:03 PM Subject: question about R graphics-example plot attached To: [EMAIL PROTECTED] Suppose I have the data set

[R] question about the dataset fgl

2005-11-10 Thread Huh, Seungho
Dear sir or ma'am, I have a question about the dataset fgl. The dataset seems to be in the VR package, so I tried to download it from CRAN. However, after downloading, when I tried to load the package, it was not in my package list. I am wondering what is wrong. Any advice on how to access

Re: [R] question about the dataset fgl

2005-11-10 Thread Liaw, Andy
`VR' is a bundle consisting of `MASS', `class', `nnet' and `spatial', as the description says. The fgl data is in the MASS package, so you need to load that one. In any case, data() would have told you that after the bundle is installed. Andy From: Huh, Seungho Dear sir or ma'am, I

[R] question about R graphics-example plot attached

2005-11-08 Thread jia ding
-- Forwarded message -- From: jia ding [EMAIL PROTECTED] Date: Nov 2, 2005 4:03 PM Subject: question about R graphics-example plot attached To: [EMAIL PROTECTED] Suppose I have the data set like this: A 1 3 7 10 B 5 9 13 The numbers here actually is A or B's occurence

Re: [R] question about R graphics-example plot attached

2005-11-08 Thread Marc Schwartz
On Tue, 2005-11-08 at 14:08 +0100, jia ding wrote: -- Forwarded message -- From: jia ding [EMAIL PROTECTED] Date: Nov 2, 2005 4:03 PM Subject: question about R graphics-example plot attached To: [EMAIL PROTECTED] Suppose I have the data set like this: A 1 3 7 10 B 5

Re: [R] question about precision, floor, and powers of two.

2005-11-08 Thread Patrick Connolly
On Fri, 04-Nov-2005 at 04:58PM +0100, Peter Dalgaard wrote: | In this particular case, it is slightly odd that we can't get an exact | answer for operations that could in principle be carried out using | integer arithmetic, but we're actually calculating log(8)/log(2). | | (Curiously, the same

Re: [R] question on adding confidence intervals

2005-11-06 Thread Spencer Graves
Have you considered arima and predict.Arima? spencer graves Renuka Sane wrote: I am trying to do a forecasting exercise for a series, x. My forecast model consists of the following I first regress log(x) on time and dummy variables for each month. lm(log(x) ~ time +

[R] question about R code

2005-11-05 Thread Yuying Shi
Dear Sir/Madam, If I have matrics as follows: a - c(1,1,0,0) b - c(4,4,0,0) c - c(3,5,5,6) How can I use R code to solve the equation ax^2+bx+c=0. thanks! yuying shi [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing

[R] question about R code

2005-11-05 Thread Yuying Shi
Dear Sir/Madam, If I have matrics as follows: a - c(1,1,0,0) b - c(4,4,0,0) c - c(3,5,5,6) How can I use R code to solve the equation ax^2+bx+c=0. thanks! yuying shi [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing

Re: [R] question about R code

2005-11-05 Thread Ted Harding
On 05-Nov-05 Yuying Shi wrote: Dear Sir/Madam, If I have matrics as follows: a - c(1,1,0,0) b - c(4,4,0,0) c - c(3,5,5,6) How can I use R code to solve the equation ax^2+bx+c=0. thanks! yuying shi I'm not sure what your question really should be, but taking it at face value and not

[R] question about precision, floor, and powers of two.

2005-11-04 Thread Dr Carbon
At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? log2(2^2); floor(log2(2^2)) [1] 2 [1] 2 log2(2^3); floor(log2(2^3)) [1] 3 [1] 2 log2(2^4); floor(log2(2^4)) [1] 4 [1] 4 DrC

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Uwe Ligges
Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because log2(2^3) - 3 [1] -4.440892e-16 see the R FAQ Why doesn't R think these numbers are equal?. Uwe

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Peter Dalgaard
Uwe Ligges [EMAIL PROTECTED] writes: Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because log2(2^3) - 3 [1] -4.440892e-16 see the R FAQ Why

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Prof Brian Ripley
On Fri, 4 Nov 2005, Peter Dalgaard wrote: Uwe Ligges [EMAIL PROTECTED] writes: Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because log2(2^3) - 3 [1]

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Berton Gunter
In this particular case, it is slightly odd that we can't get an exact answer for operations that could in principle be carried out using integer arithmetic, but we're actually calculating log(8)/log(2). (Curiously, the same effect is not seen on Linux or Solaris until log2(2^29)-29

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Duncan Murdoch
On 11/4/2005 10:58 AM, Peter Dalgaard wrote: Uwe Ligges [EMAIL PROTECTED] writes: Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Thomas Lumley
On Fri, 4 Nov 2005, Uwe Ligges wrote: Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because log2(2^3) - 3 [1] -4.440892e-16 This is a less

Re: [R] question about precision, floor, and powers of two.

2005-11-04 Thread Prof Brian Ripley
On Fri, 4 Nov 2005, Thomas Lumley wrote: On Fri, 4 Nov 2005, Uwe Ligges wrote: Dr Carbon wrote: At the risk of being beaten about the face and body, can somebody explain why the middle example: log2(2^3); floor(log2(2^3)) is different than examples 1 and 3? Because log2(2^3) - 3 [1]

[R] question on adding confidence intervals

2005-10-29 Thread Renuka Sane
I am trying to do a forecasting exercise for a series, x. My forecast model consists of the following I first regress log(x) on time and dummy variables for each month. lm(log(x) ~ time + monthly dummies) I then use predict() to obtain a prediction for the next year. I then fit an AR(6)/AR(12)

Re: [R] question about sm.density

2005-10-28 Thread Francisco J. Zagmutt
PROTECTED] To: r-help@stat.math.ethz.ch Subject: [R] question about sm.density Date: Thu, 27 Oct 2005 18:47:28 -0700 (PDT) How can I draw a 95% contour in sm.density? For example, y - cbind(rnorm(50), rnorm(50)) sm.density(y, display = slice) will give 25%, 50% and 75% contours automatically

[R] question about sm.density

2005-10-27 Thread Cunningham Kerry
How can I draw a 95% contour in sm.density? For example, y - cbind(rnorm(50), rnorm(50)) sm.density(y, display = slice) will give 25%, 50% and 75% contours automatically, but no reference on other values. __ R-help@stat.math.ethz.ch mailing

Re: [R] question about sm.density

2005-10-27 Thread Prof Brian Ripley
On Thu, 27 Oct 2005, Cunningham Kerry wrote: How can I draw a 95% contour in sm.density? For example, y - cbind(rnorm(50), rnorm(50)) sm.density(y, display = slice) will give 25%, 50% and 75% contours automatically, but no reference on other values. See ?sm.options, the place to set

Re: [R] question about technieque do with large computation

2005-10-24 Thread Uwe Ligges
ronggui wrote: The green book tells:The basic technique is classic :keep it simple .A long ,complicated expression or function is less fravorable than a relatively small computations that combines calls to a few other functions to perform its tasks. But I don't get the point totally.Can

[R] question about technieque do with large computation

2005-10-23 Thread ronggui
The green book tells:The basic technique is classic :keep it simple .A long ,complicated expression or function is less fravorable than a relatively small computations that combines calls to a few other functions to perform its tasks. But I don't get the point totally.Can anyone give me an

Re: [R] question about ?list

2005-10-17 Thread Prof Brian Ripley
The help page means exactly what it says, but the English is too subtle and I have reworded it. I have no idea why you are interested in pairlists (they are hardly used at user-visible level these days). The point is that pairlist() is NULL and so strictly not a pairlist at all (try typeof()

[R] question about ?list

2005-10-14 Thread ronggui
the help page says: 'is.list' returns 'TRUE' iff its argument is a 'list' _or_ a 'pairlist' of 'length' 0, whereas 'is.pairlist' only returns 'TRUE' in the latter case. does the latter case mean a 'pairlist' of 'length' 0? but is.pairlist(pairlist()) [1] TRUE length(pairlist())

<    1   2   3   4   5   6   7   8   9   10   >