[R] Rubin's rules of multiple imputation

2011-01-30 Thread Joe P King
Hello all, if I have multiple imputed data sets, is there a command or function in R in any package you know of to combine those, I know one common MI approach is rubins rules, is there a way to do this using his rules or others? I know theres ways, like using Amelia from Gary King's website to cre

[R] rj packages and eclipse

2011-01-30 Thread Sebastián Daza
Hi everyone! Does anyone know how to install the rj package in Windows (7)? I am trying to set up eclipse, but I got [INFO] The R package 'rj' is not available, R-StatET tools cannot be initialized. Thank you in advance! __ R-help@r-project.org mai

Re: [R] List of all times zones in R

2011-01-30 Thread Joe P King
Type in letters into command prompt > letters [1] "a" "b" "c" "d" "e" "f" "g" "h" "i" "j" "k" "l" "m" "n" "o" "p" "q" "r" "s" [20] "t" "u" "v" "w" "x" "y" "z" Joe King 206-913-2912 j...@joepking.com Ad astra per aspera – “Through hardships to the stars” -Original Message- From: r-help-

[R] List of all times zones in R

2011-01-30 Thread Maithula Chandrashekhar
Hi all, in R I have Sys.timezone() function to get the current working Time zone. However I want to have a vector to get the list of all available time zones, like say, LETTERS gives me all letters. Is there any function like that? Thanks in advance, __

Re: [R] leap year and order function

2011-01-30 Thread Bill.Venables
> yearLength <- function(year) 365 + (year %% 4 == 0) > yearLength(1948:2010) [1] 366 365 365 365 366 365 365 365 366 365 365 365 366 365 365 365 366 365 365 365 366 [22] 365 365 365 366 365 365 365 366 365 365 365 366 365 365 365 366 365 365 365 366 365 [43] 365 365 366 365 365 365 366 365 36

Re: [R] Finding a Diff within a Dataframe columns

2011-01-30 Thread Ramya
Hi jholtman, Thanks a ton it just worked. if you dont mind can you explain the code it a little sapply(seq(from = 1, by = 2, length = ncol(x) %/% 2), function(a){ + x[[a]] - x[[a + 1]] + }) wat is the purpose of double percent sign and is the sapply the function we generally use for the Da

Re: [R] Missing at random

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 10:01 PM, assaedi76 assaedi76 wrote: R users: Thanks in advance How to generate missing at random (MAR)? > missidx <- sample(1:nrow(dfrm), nrow(dfrm)*frac) > is.na(dfrm$measure) <- 1:nrow(dfrm) %in% missidx assaed...@yahoo.com Thanks [[alternative HTML

[R] leap year and order function

2011-01-30 Thread Bobby Lee
im trying to write a for loop so that every leap year, the number of days becomes to 366 instead of 365. could someone help me out? and also, this set of data has 99.99s I set all the 99.99 ==NA. however, when im doing the order function to find the max value of that year, it still reads 99.99 as t

Re: [R] Question on ploting multiple series on the same plot

2011-01-30 Thread jim holtman
What you are proposing is a reasonable way of reading all the files into a list object were each element is a separate file. You can then iterate through the list to determine the range for the plot. If the data is of different lenghts, then what are you plotting against? Is it just a single var

[R] How to include a few selected AR terms

2011-01-30 Thread Moohwan Kim
Dear R family, I have a quick question. m3=arima(zt,order=c(6,0,2)) % fit an ARIMA(6,0,2) model to zt. This equation contains all 6 AR terms plus 1 MA term. I want to include only AR(2) and MA(1) excluding the other terms. How could I accomplish it? best, moohwan __

Re: [R] Finding a Diff within a Dataframe columns

2011-01-30 Thread jim holtman
try this: > x A B CD 1 0.1 0.7 0.9 0.80 2 0.2 0.6 0.8 0.70 3 0.4 0.8 0.7 0.76 > source('clipboard') > x <- read.table(textConnection("A B C D + 0.10.7 0.9 0.8 + 0.20 0.60 0.80 0.70 + 0.40 0.80 0.70 0.76"), header = TRUE) > closeAllConnections() > sapply(seq

Re: [R] Finding a Diff within a Dataframe columns

2011-01-30 Thread Santosh Srinivas
Please take a look at the introduction to R too ... > df <- read.delim(textConnection(Lines),sep="") > df A B CD 1 0.1 0.7 0.9 0.80 2 0.2 0.6 0.8 0.70 3 0.4 0.8 0.7 0.76 > d['A-B'] <- with(df, A-B) Error in d["A-B"] <- with(df, A - B) : object 'd' not found > d$v1 <- with(df, A-B) Erro

[R] Finding a Diff within a Dataframe columns

2011-01-30 Thread Ramya
Hi, I have a Dataframe. A B C D 0.10.7 0.9 0.8 0.20 0.60 0.80 0.70 0.40 0.80 0.70 0.76 I need a resultant dataframe (A-B) (C-D) -0.6 0.1 -0.400.1 -0.40 -0.06 Any suggestion would be of a great help Thanks Ramya -- View this message in context: http

Re: [R] User error in calling predict/model.frame

2011-01-30 Thread russell . s . pierce
You are right, of course. Unanticipated. The work arounds are pretty straightforward, I just lacked the imagination to see why they were necessary. Best, Russell Sent via BlackBerry -Original Message- From: Joshua Wiley Date: Sun, 30 Jan 2011 18:22:29 To: Russell Pierce Cc: r-help Su

[R] Question on ploting multiple series on the same plot

2011-01-30 Thread Shashank Khanvilkar
Thanks in advance for all help , I just started using R and have already done the following. 1. Read through multiple files to get input data 2. plot a vector (X say) 3. end Now i want to plot the vector X for different files on the same plot, and I don't know how to do that. One option I consi

[R] Missing at random

2011-01-30 Thread assaedi76 assaedi76
R users: Thanks in advance  How to generate missing at random (MAR)? assaed...@yahoo.com Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] R-/Text-editor for Windows?

2011-01-30 Thread Eduardo de Oliveira Horta
I'm testing StatET right now. Seems nice. In many aspects it resembles the features offered by RKWard (which is a KDE application and thus also platform independent... in principle. No pre-compiled OSX version yet). For those interested, I found an explanation on how to set StatET running. Might b

Re: [R] User error in calling predict/model.frame

2011-01-30 Thread Joshua Wiley
On Sun, Jan 30, 2011 at 5:59 PM, Russell Pierce wrote: > R-help list and interested parties, > > On Cross Validated mpiktas correctly noted that both the I() and rms > Glm/Predict solution produce incorrect results You probably meant it this way anyways, but I would say it produces undesired resu

Re: [R] ggplot2 -- scale_colour_manual()

2011-01-30 Thread Robert Baer
Well time to confess ... The problem is with the learner (me) not the teacher (Hadley). There is no bug. I did not reproduce what Hadley wrote, but sorting it out got me a step closer to the top of the mountain. I had two mistakes in the code I posted: 1) color must be inside the aes() func

Re: [R] User error in calling predict/model.frame

2011-01-30 Thread Russell Pierce
R-help list and interested parties, On Cross Validated mpiktas correctly noted that both the I() and rms Glm/Predict solution produce incorrect results (http://stats.stackexchange.com/questions/6684/how-can-one-use-the-predict-function-on-a-lm-object-where-the-ivs-have-been-dynam/6718#6718). As f

Re: [R] ggplot2 -- scale_colour_manual()

2011-01-30 Thread Dennis Murphy
Hi: I get the same result as you did. Perhaps the problem is the failure to define breaks in the scale code. The issue, of course, is to figure out what should be the breaks... One approach is to go back into the data, add variables below and above, melt the data frame to stack below and above in

Re: [R] arules package question- apriori/S4 object export question

2011-01-30 Thread John Dennison
Thanks for the help. I am working through the write.csv command and the using Google Refine to clean it up into a table. Great Program: http://code.google.com/p/google-refine/wiki/GettingStarted Ill look into the XML parser that may be

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread jim holtman
How about considering 'embed': > d Date Close 1 2011-01-28 56.42 2 2011-01-27 57.37 3 2011-01-26 56.48 4 2011-01-25 56.39 5 2011-01-24 55.74 6 2011-01-21 55.46 > x <- embed(d$Close, 4) > x [,1] [,2] [,3] [,4] [1,] 56.39 56.48 57.37 56.42 [2,] 55.74 56.39 56.48 57.37 [3,] 55.46 55.

Re: [R] problem reading file containing bit vector

2011-01-30 Thread jim holtman
I think you want to make sure you read it is as character: > x <- read.table(textConnection('"swissProtID""entrezID""bitVec" + "Q62924" "---""10001000" + "P18897" "---""01000100" + "Q62736" "---"

Re: [R] Error in { : task 3 failed - "NA/NaN argument"

2011-01-30 Thread Joshua Wiley
Hi Jim, On Sun, Jan 30, 2011 at 2:38 PM, Maas James Dr (MED) wrote: > I'm attempting to run a rather complex routine that involves a few loops, and > even some use of foreach and doMPI.  I just added another external loop and > now get this error message. Well the fact that the error started o

Re: [R] bit wise operation on long bit vector?

2011-01-30 Thread jim holtman
Check out the 'bit' package on CRAN and see if that is what you are looking for. On Sun, Jan 30, 2011 at 2:51 PM, Fahim M wrote: > Hi > Is there any function to do bitwise or/and/xor on long bit vectors? > > "a" > "..

Re: [R] Using the vars package to find time series corelations or impact

2011-01-30 Thread inhoue
Also, if any of you all came across any tutorial that guide reader through how to use VAR with the result interpretation (may be also using this package or other package), please post it here. Thanks so much! -- View this message in context: http://r.789695.n4.nabble.com/Using-the-vars-package-t

Re: [R] Help in getting info from a DataFrame

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 5:27 PM, ADias wrote: dados<- data .frame (Store = c ("Setubal ","lx ","Aveiro ","Coimbra ","Aveiro","Evora","Aveiro","Coimbra","Setubal"),Prod=c("Bloco Desenho","Bloco Desenho ","Tinteiro ","Régua ","Lapiseira ","Regua ","Tinteiro","Lapiseira","Lapiseira"),qt

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Joshua Ulrich
On Sun, Jan 30, 2011 at 1:39 PM, eric wrote: > > I'd like to use vectorization to take a 4 point moving window on standard > deviation on the close column and create another variable (st.dev) in the > dataframe. Here's the dataframe > > > head(xyz) >        Date Close > 1 2011-01-28 56.42 > 2 2011

Re: [R] Where does R look for library packages - there is no package called 'BRugs'

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 5:42 PM, conor1725 wrote: I am have installed R on Windows 7 machine. R got installed in the directory C:\Program Files\R\R-2.12.0. Then I installed the package BRugs using the install.packages command. I did not get an option during the installation as to what direc

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Pete Brecknock
I believe there are two reasons why your code doesn't work 1. You should replace sd(Close[i]:Close[(i-3)]) with sd(Close[(i-3):i]). This will ensure you select the appropriate obsevations to feed in the sd function. 2. Per Ray's point above, you need to output the calculated value of sd fo

[R] Where does R look for library packages - there is no package called 'BRugs'

2011-01-30 Thread conor1725
I am have installed R on Windows 7 machine. R got installed in the directory C:\Program Files\R\R-2.12.0. Then I installed the package BRugs using the install.packages command. I did not get an option during the installation as to what directory I wanted BRugs installed in. It ended up in C:\myuse

[R] Help in getting info from a DataFrame

2011-01-30 Thread ADias
Hi, I have a data.frame and I need to know witch store sold more "Lapiseiras". I got a point where I am almost sure I am very closed to the answer but I am missing somethiing. So, the data frame is this one dados<-data.frame(Store=c("Setubal","lx","Aveiro","Coimbra","Aveiro","Evora","Aveiro","

[R] Error in { : task 3 failed - "NA/NaN argument"

2011-01-30 Thread Maas James Dr (MED)
I'm attempting to run a rather complex routine that involves a few loops, and even some use of foreach and doMPI. I just added another external loop and now get this error message. Error in { : task 3 failed - "NA/NaN argument" Is there a way to debug what is causing this error or where? I re

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Ray Brownrigg
On Mon, 31 Jan 2011, eric wrote: > I'd rather do this without getting into zoo objects at the moment. OK, how > about with a simple loop ? Why doesn't this work ? > > attach(xyz) > j <- for(i in 4: length(Close)) sd(Close[i]:Close[(i-3)]) To answer your question, it is because the value returned f

Re: [R] arules package question- apriori/S4 object export question

2011-01-30 Thread Michael Hahsler
Hi John, You can use WRITE (see ? WRITE) to save rules to a file in the from: {a,b,c} => {d} 0.1 0.3 2.2 where the numbers after the rule are support, confidence and lift. There is no csv export since the number of items in the rules varies and the data structure can not be converted into a si

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Pete Brecknock
how about ... j=NULL for(i in 4: length(xyz$Close)) { j[i] = sd(xyz$Close[i-3:i]) } print(j) -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-a-moving-window-on-standard-deviation-tp3247566p3247634.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread eric
I'd rather do this without getting into zoo objects at the moment. OK, how about with a simple loop ? Why doesn't this work ? attach(xyz) j <- for(i in 4: length(Close)) sd(Close[i]:Close[(i-3)]) -- View this message in context: http://r.789695.n4.nabble.com/How-to-do-a-moving-window-on-standar

Re: [R] Extract subsets of different and unknown lengths from huge dataset

2011-01-30 Thread Phil Spector
A reproducible example would be nice, but if I understand you, you want to find the index of values which are preceded by at least 24 zeroes. The rle (run length encoding) function is very handy for problems like these. Suppose the vector of interest is called "vec". To create a vector call

Re: [R] bit wise operation on long bit vector?

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 2:51 PM, Fahim M wrote: Hi Is there any function to do bitwise or/and/xor on long bit vectors? "a" " .." "b" "001110001100 ...

[R] Reading from files to 2D matrix

2011-01-30 Thread kparamas
Hi, I am reading from many files DYNAMICALLY into a 2D matrix using row bind. I am not able to do with the code below. for(years in c(1:NUM_YEARS)) { for(weeks in seq(1,NUM_WEEKS,LAG_WEEKS)) { currentYear = BASE_YEAR + years; if(weeks < 9) fileName

Re: [R] How to do a moving window on standard deviation

2011-01-30 Thread Pete Brecknock
One way is to convert your data into a zoo object and use the rollapply function # Your data lines = "Date Close 2011-01-28 56.42 2011-01-27 57.37 2011-01-26 56.48 2011-01-25 56.39 2011-01-24 55.74 2011-01-21 55.46" d = read.table(textConnection(lines), header = TRUE) # create zoo object d.z=z

[R] R-Sweave WinEdt support has been updated

2011-01-30 Thread Gilbert Ritschard
Hello everybody. The R-Sweave WinEdt support for R and Sweave has been updated for both WinEdt 6 and the x64/i386 bin directories introduced since R 2.12.0. It includes a smooth install macro. The support can be downloaded from http://www.winedt.org/Config/modes/R-Sweave.php . Just try it. C

Re: [R] Graphic help

2011-01-30 Thread Sarah Goslee
It's hard to tell from your very scanty description, but it sounds like your data were imported as factor. You can change the levels of the factor to be in the order you prefer, rather than the default alphabetical order. See ?factor and ?as.factor for more information. Also, now that you are arme

[R] bit wise operation on long bit vector?

2011-01-30 Thread Fahim M
Hi Is there any function to do bitwise or/and/xor on long bit vectors? "a" ".." "b" "001110001100.." "c" "

Re: [R] Help plz

2011-01-30 Thread Pete Brecknock
Typing "?" (no quotes) followed by a topic of interest will throw up the R Help documentation. 1. Have a look at ?runif 2. Try ?subset and ?cumsum 3. Look at ?rle. Use in conjunction with cumsum and maybe ifelse. HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/Help-p

[R] How to do a moving window on standard deviation

2011-01-30 Thread eric
I'd like to use vectorization to take a 4 point moving window on standard deviation on the close column and create another variable (st.dev) in the dataframe. Here's the dataframe head(xyz) Date Close 1 2011-01-28 56.42 2 2011-01-27 57.37 3 2011-01-26 56.48 4 2011-01-25 56.39 5 2011-01-2

Re: [R] ggplot2 -- scale_colour_manual()

2011-01-30 Thread dicko ahmadou
Hi robert, It's not a typo, i have the book and the right code is : huron <- data.frame(year=1875:1972,level=LakeHuron) p <- ggplot(huron, aes(year)) + geom_line(aes(y= level - 5, colour = 'blue')) + geom_line(aes(y= level + 5, colour = 'red')) print(p) So colour must inside aes -- Vi

[R] Graphic help

2011-01-30 Thread christina matesanz
Hi When I plot my date (numeric~date) R changes the order of my variables such that June comes after August. How do I keep the variables from my data sheet in the same order? Regards Cristina __ R-help@r-project.org mailing list https://stat.ethz.c

[R] Extract subsets of different and unknown lengths from huge dataset

2011-01-30 Thread Dustin
Dear prospective reader, I apologize for posting my problem but I've just no idea how to go on by processing this huge (over 70 MB) dataset. Thank you in advance for any help or comment! I do appreciate it! My textfile contains 1 column of interest (numbers/values only). The overall issue is to

[R] ggplot2 -- scale_colour_manual()

2011-01-30 Thread Robert Baer
According to Hadley's ggplot book (p. 109), both the graphs below should have a legend, and yet none appears in my hands. Any suggestions? I can't see a typo. Is there a bug? library(ggplot2) data(LakeHuron) huron = data.frame(year=1875:1972,level=LakeHuron) p = ggplot(huron, aes(year)) +

Re: [R] deSolve: Problem solving ODE including modulo-operator

2011-01-30 Thread Thomas Petzoldt
Dear Albert2002, there is no problem with deSolve and, of course, no problem with R's modulo operator, but there are at least two errors in your model formulation: 1.) The order of the returned derivatives must be exactly the same as specified in the state variables. This is documented in th

Re: [R] problem reading file containing bit vector

2011-01-30 Thread Fahim M
Its working now. I was missing something. dataFile = read.table("./Data/occTable.csv", sep ='\t', header=TRUE, colClasses = "character"); i=1 x = dataFile[i,]; x Thanks a lot. On Sun, Jan 30, 2011 at 12:25 PM, David Winsemius wrote: > > On Jan 30, 2011, at 12:22 PM, Fahim M wrote: > > Hi I

Re: [R] Positive Definite Matrix

2011-01-30 Thread Mike Miller
On Sun, 30 Jan 2011, David Winsemius wrote: On Jan 30, 2011, at 6:02 AM, Alex Smith wrote: Thank you for all your input but I'm afraid I dont know what the final conclusion is. I will have to check the the eigenvalues if any are negative. Why would setting them to zero make a difference? Sorr

Re: [R] medians in Wilcoxon disagree with median function

2011-01-30 Thread Graham Smith
David, > > I am sure I am opening myself up to looking stupid, >> > > Or exposing a failure to read the help page. Well no, and of course I did read the help pages as well as several introductions on Wilcoxon before posting, but as I said in my other post it is generally not at all clear, the

Re: [R] Positive Definite Matrix

2011-01-30 Thread Mike Miller
On Sun, 30 Jan 2011, David Winsemius wrote: On Jan 30, 2011, at 6:02 AM, Alex Smith wrote: Thank you for all your input but I'm afraid I dont know what the final conclusion is. I will have to check the the eigenvalues if any are negative. Why would setting them to zero make a difference? Sorr

Re: [R] Extract time only from POSIXlt object

2011-01-30 Thread Simon Goodman
Those are all really helpful responses. Got it sorted now. Many thanks indeed! -- View this message in context: http://r.789695.n4.nabble.com/Extract-time-only-from-POSIXlt-object-tp3246751p3247105.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Finding the correlation coefficient of two stocks

2011-01-30 Thread Pete Brecknock
Dieter is correct, the lengths of the 2 series are different Try s = merge(s1,s2) corr = cor(s[,"Close.s1"],s[,"Close.s2"],use="pairwise.complete.obs") print(corr) HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/Finding-the-correlation-coefficient-of-two-stocks

Re: [R] R-/Text-editor for Windows?

2011-01-30 Thread jthetzel
Sascha, I second Tobias' recommendation of Eclipse with StatET. Like Emacs, Eclipse is platform independent and easily extensible to essentially any other language, as well as revision control like git and svn. I used to use Tinn-R, but haven't been back seen switching to Eclipse. Jeremy Jere

Re: [R] problem reading file containing bit vector

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 12:22 PM, Fahim M wrote: Hi I have a tab delimited file with fillowing content: "swissProtID""entrezID""bitVec" "Q62924" "---""10001000" "P18897" "---""01000100" "Q62736" "--

Re: [R] Positive Definite Matrix

2011-01-30 Thread Ravi Varadhan
Hi, You should know about symmetry from the way in which your matrix is generated. Assuming that it is symmetric, the easiest thing would be to always use the `nearPD' function in the "Matrix" package when you suspect that your matrix could be indefinite. An important thing to keep in mind i

[R] problem reading file containing bit vector

2011-01-30 Thread Fahim M
Hi I have a tab delimited file with fillowing content: "swissProtID""entrezID""bitVec" "Q62924" "---""10001000" "P18897" "---""01000100" "Q62736" "---""10100010" "P13589"

Re: [R] Extracting a (*specific*) variable name from a list of function arguments (not "...")

2011-01-30 Thread Tal Galili
Uwe and Marc, Many thanks to both of you for the answers. BTW, I wanted it for handling this case (a single variable inside a data variable) in the boxplot wrapper I recently wrote: http://www.r-statistics.com/2011/01/how-to-label-all-the-outliers-in-a-boxplot/ With regards, Tal --

Re: [R] Positive Definite Matrix

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 6:02 AM, Alex Smith wrote: Thank you for all your input but I'm afraid I dont know what the final conclusion is. I will have to check the the eigenvalues if any are negative. Why would setting them to zero make a difference? Sorry to drag this on. The discussion is p

Re: [R] Extracting a (*specific*) variable name from a list of function arguments (not "...")

2011-01-30 Thread Marc Schwartz
On Jan 30, 2011, at 10:38 AM, Tal Galili wrote: > Hello all, > > I would like to extract the variable name passed into a specific argument of > a function. > Using match.call() will give me a list of arguments and what was passed into > them, but I couldn't find how to get a particular argument o

Re: [R] Extracting a (*specific*) variable name from a list of function arguments (not "...")

2011-01-30 Thread Uwe Ligges
On 30.01.2011 17:38, Tal Galili wrote: Hello all, I would like to extract the variable name passed into a specific argument of a function. Using match.call() will give me a list of arguments and what was passed into them, but I couldn't find how to get a particular argument out of it (at least

Re: [R] medians in Wilcoxon disagree with median function

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 9:28 AM, Graham Smith wrote: I am sure I am opening myself up to looking stupid, Or exposing a failure to read the help page. but I have two samples with medians of 613.5 and 189 (difference in location of 424 compared to the difference suggested from the wilcoxon o

[R] Extracting a (*specific*) variable name from a list of function arguments (not "...")

2011-01-30 Thread Tal Galili
Hello all, I would like to extract the variable name passed into a specific argument of a function. Using match.call() will give me a list of arguments and what was passed into them, but I couldn't find how to get a particular argument out of it (at least without using some string manipulation).

Re: [R] environment question: changing variables from a formula through model.frame?

2011-01-30 Thread Tal Galili
Hello Niels, Thank you very much! Your solution was exactly what I needed. (I didn't realize that "formula" has it's own environment - very useful!) Best, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275

Re: [R] how to enter frequency type data in R with class intervals

2011-01-30 Thread David Winsemius
On Jan 30, 2011, at 5:48 AM, arindam fadikar wrote: Dear all, Given data of a continuous frequency distribution with class intervals .. how to enter such data so that we can use the normal mean, median and mode functions to calculate them and also can draw histogram .. for example how to

Re: [R] barchart panel.text add label value and percent

2011-01-30 Thread Christophe Bouffioux
yes exactly thank you Peter On Sun, Jan 30, 2011 at 2:24 PM, Peter Ehlers wrote: > On 2011-01-26 04:56, Christophe Bouffioux wrote: > >> Hello everybody, >> >> i need some help to display text as label in my barchart >> the label is the combination of x value + text >> text= calculated percenta

Re: [R] medians in Wilcoxon disagree with median function

2011-01-30 Thread Prof Brian Ripley
Where did you get the idea that the location estimate in a 2-sample Wilcoxon test is the difference in medians? (It is a common misconception, but not I believe to be found in R. The estimate is the median of differences, not the difference of medians: and the test is not of a difference of p

Re: [R] medians in Wilcoxon disagree with median function

2011-01-30 Thread Graham Smith
I am sure I am opening myself up to looking stupid, but I have two samples > with medians of 613.5 and 189 (difference in location of 424 compared to > the difference suggested from the Wilcoxon of 291.5) > > After a rather frustrating search, with it only explained in one of the books I found. I

[R] medians in Wilcoxon disagree with median function

2011-01-30 Thread Graham Smith
I am sure I am opening myself up to looking stupid, but I have two samples with medians of 613.5 and 189 (difference in location of 424 compared to the difference suggested from the wilcoxon of 291.5) > wilcox.test(pipwtCount,pipwdCount, conf.int=TRUE, na.rm=TRUE) Wilcoxon rank sum test da

Re: [R] Positive Definite Matrix

2011-01-30 Thread Spencer Graves
I think the bottom line can be summarized as follows: 1. Give up on Cholesky factors unless you have a matrix you know must be symmetric and strictly positive definite. (I seem to recall having had problems with chol even with matrices that were theoretically positive or n

Re: [R] barchart panel.text add label value and percent

2011-01-30 Thread Peter Ehlers
On 2011-01-26 04:56, Christophe Bouffioux wrote: Hello everybody, i need some help to display text as label in my barchart the label is the combination of x value + text text= calculated percentage => per it display properly the x value but, wrongly repeats the text of the fisrt level LangueTXT

Re: [R] Extract time only from POSIXlt object

2011-01-30 Thread Gabor Grothendieck
On Sat, Jan 29, 2011 at 7:45 PM, Simon Goodman wrote: > > How can I extract only the time component from an POSIXlt object? > > For example if I try the following it still returns both the date and > time... > >>as.POSIXlt(tr.date[1]) > [1] "2010-10-18 21:46:53" >>as.POSIXlt(tr.date[1],"%H:%M:%S")

Re: [R] Finding the correlation coefficient of two stocks

2011-01-30 Thread Dieter Menne
veepsirtt wrote: > > corr <- cor(s1,s2) > Error in cor(s1, s2) : incompatible dimensions > > Check lenghts of your series. cor(c(1,2),c(1,2,3)) #Error in cor(c(1, 2), c(1, 2, 3)) : incompatible dimensions Dieter -- View this message in context: http://r.789695.n4.nabble.com/Finding-t

[R] Using the vars package to find time series corelations or impact

2011-01-30 Thread inhoue
Hi you all, I have couple of questions regarding how to use the vars package (the vector autoregression model) to find co-relation/ impact between multiple time series. I am not majoring in economic, I just want to use vars to check how those time series I had impacting each other. I also hope th

Re: [R] Positive Definite Matrix

2011-01-30 Thread Alex Smith
Thank you for all your input but I'm afraid I dont know what the final conclusion is. I will have to check the the eigenvalues if any are negative. Why would setting them to zero make a difference? Sorry to drag this on. Thanks On Sat, Jan 29, 2011 at 9:00 PM, Prof Brian Ripley wrote: > On Sat,

Re: [R] package R2WinBUGS question; was: Multilevel

2011-01-30 Thread Uwe Ligges
On 29.01.2011 19:27, Ben Bolker wrote: Uwe Ligges statistik.tu-dortmund.de> writes: On 29.01.2011 15:06, martanair wrote: [snip] I write: radon.data<- list ("n", "J", "x", "y", "county") radon.inits<- function (){ list (a=rnorm(J), b=rnorm(1), mu.a=rnorm(1), sigma.y=run

[R] how to enter frequency type data in R with class intervals

2011-01-30 Thread arindam fadikar
Dear all, Given data of a continuous frequency distribution with class intervals .. how to enter such data so that we can use the normal mean, median and mode functions to calculate them and also can draw histogram .. for example how to enter this data in R Height range[image: ↓]

Re: [R] Sparse matrix multiplication

2011-01-30 Thread Feng Li
Thanks Martin. That is exactly what I want. Feng On Sat, Jan 29, 2011 at 11:59 PM, Martin Maechler < maech...@stat.math.ethz.ch> wrote: > > "FL" == Feng Li > > on Sat, 29 Jan 2011 19:46:48 +0100 writes: > >FL> I meant "sparse matrix", sorry for the typo. > aha.. :-) > > >FL>

Re: [R] Extract time only from POSIXlt object

2011-01-30 Thread Jeff Newmiller
Try tt <- as.POSIXct("2011-01-29 15:00") tt-trunc(tt,"days") Note that this result can be used to add or subtract from datetime values, but I don't know of a convenient way to represent it as HH:MM:SS format. "Simon Goodman" wrote: > >How can I extract only the time component from an POSIXlt

Re: [R] environment question: changing variables from a formula through model.frame?

2011-01-30 Thread Niels Richard Hansen
Hi Tal On 29/01/11 13.25, Tal Galili wrote: Hello all, I came across a behavior of R with environments that I'm not sure what is causing it. It involves changing variables that are found through using model.frame on a formula inside a function. I wonder if it's a "bug" or a "feature". And in e