[R] predict.lrm vs. predict.glm (with newdata)

2010-12-25 Thread Stefan Th. Gries
Hi all I have run into a case where I don't understand why predict.lrm and predict.glm don't yield the same results. My data look like this: set.seed(1) library(Design); ilogit - function(x) { 1/(1+exp(-x)) } ORDER - factor(sample(c(mc-sc, sc-mc), 403, TRUE)) CONJ - factor(sample(c(als, bevor,

Re: [R] Help required: binomial option pricing using package

2010-12-25 Thread Tal Galili
Hi Sonal, The example you gave is not reproducible since we don't have data as you do. However, here is an example of how to access the object you are after: tmp - CRRBinomialTreeOption(TypeFlag = pa, S = 50, X = 50, Time = 5/12, r = 0.1, b = 0.1, sigma = 0.4, n = 5) t...@price Cheers,

[R] need help with data management

2010-12-25 Thread analys...@hotmail.com
I have a data frame that reads client ID date transcations 323232 11/1/2010 22 323232 11/2/2010 0 323232 11/3/2010 missing 121212 11/10/2010 32 12121211/11/2010 15 . I want to order the rows by client ID and date and using a black-box forecasting

[R] Where to find rcompgen package?

2010-12-25 Thread Megh Dal
Dear all, can somebody point me from where to download rcompgen package? CRAN does not seem to hold that. Installing this package through install.packages() tells this package is not available. Thanks [[alternative HTML version deleted]] __

Re: [R] Where to find rcompgen package?

2010-12-25 Thread David Winsemius
On Dec 25, 2010, at 8:08 AM, Megh Dal wrote: Dear all, can somebody point me from where to download rcompgen package? CRAN does not seem to hold that. http://lmgtfy.com/?q=rcompgen Installing this package through install.packages() tells this package is not available. Thanks

Re: [R] need help with data management

2010-12-25 Thread David Winsemius
On Dec 25, 2010, at 8:08 AM, analys...@hotmail.com wrote: I have a data frame that reads client ID date transcations 323232 11/1/2010 22 323232 11/2/2010 0 323232 11/3/2010 missing 121212 11/10/2010 32 12121211/11/2010 15 . I want to order the

Re: [R] need help with data management

2010-12-25 Thread analys...@hotmail.com
On Dec 25, 10:17 am, David Winsemius dwinsem...@comcast.net wrote: On Dec 25, 2010, at 8:08 AM, analys...@hotmail.com wrote: I have a data frame that reads client ID date transcations 323232   11/1/2010 22 323232   11/2/2010 0 323232   11/3/2010 missing 121212   11/10/2010 32

Re: [R] selection of outputs from the function

2010-12-25 Thread ufuk beyaztas
Thanks so much Joshua Wiley you are right your function better than mine :) -- View this message in context: http://r.789695.n4.nabble.com/selection-of-outputs-from-the-function-tp3163361p3163853.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] need help with data management

2010-12-25 Thread David Winsemius
On Dec 25, 2010, at 10:45 AM, analys...@hotmail.com wrote: On Dec 25, 10:17 am, David Winsemius dwinsem...@comcast.net wrote: On Dec 25, 2010, at 8:08 AM, analys...@hotmail.com wrote: I have a data frame that reads client ID date transcations 323232 11/1/2010 22 323232

Re: [R] need help with data management

2010-12-25 Thread Gabor Grothendieck
On Sat, Dec 25, 2010 at 8:08 AM, analys...@hotmail.com analys...@hotmail.com wrote: I have a data frame that reads client ID date transcations 323232   11/1/2010 22 323232   11/2/2010 0 323232   11/3/2010 missing 121212   11/10/2010 32 121212    11/11/2010 15

Re: [R] Writing a single output file

2010-12-25 Thread Adaikalavan Ramasamy
Many ways of doing this and you have to think about efficiency and logisitcs of different approaches. If the data is not large, you can read all n files into a list and then combine. If data is very large, you may wish to read one file at a time, combining and then deleting it before reading

[R] Extracting a dataframe column as a dataframe

2010-12-25 Thread Dimitri Shvorob
x = structure(list(time = structure(c(1020232904.818, 1020232904.818 ), class = c(POSIXt, POSIXct), tzone = ), price = c(321, 323.5)), .Names = c(time, price), row.names = 1:2, class = data.frame) x1 = x[,c(price)] dput(x1) c(321, 323.5) Is there similar syntax that gets price as a

Re: [R] Lost in POSIX

2010-12-25 Thread Dimitri Shvorob
df = structure(list(t = structure(c(1033963406.044, 1033974144.847, + 1033988418.836), class = c(POSIXt, POSIXct))), .Names = t, row.names = c(NA, + 3L), class = data.frame) df$min = trunc(df$t,units=mins) does not work, Jeff; you will see that my original post suggests familiarity with

Re: [R] Lost in POSIX

2010-12-25 Thread Dimitri Shvorob
.. One issue with the solution proposed by Jeff is that the transformed column does not have the original's type: x = structure(list(time = structure(c(1020232904.818, 1020232904.818 ), class = c(POSIXt, POSIXct), tzone = ), price = c(321, 323.5), minute = c(1020232860, 1020232860)), .Names =

Re: [R] Extracting a dataframe column as a dataframe

2010-12-25 Thread Phil Spector
x['price'] price 1 321.0 2 323.5 - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] predict.lrm vs. predict.glm (with newdata)

2010-12-25 Thread Frank Harrell
Please follow the posting guide. Please provide the smallest possible self-contained example and note that conveys the problem. Note that the rms package has now replaced the Design package. Details at http://biostat.mc.vanderbilt.edu/Rrms Frank - Frank Harrell Department of Biostatistics,

[R] What is the best way to lag a time series?

2010-12-25 Thread Christian Schoder
Dear R-users, I've been using R for a while and I am very satisfied! Unfortunately, I still have not figured out an efficient and general way to construct and use lags of time series, especially when I need to work with different packages. Let me give an example. I have two time series x and y