[R] Survival Analysis Table

2004-11-01 Thread Neil Leonard
Hi, I am trying to compute a table of a Kaplan Meier survival function. I have created the Kaplan Meier using: field.KM - survfit(Surv(project_no_1983$entryage3,project_no_1983$age_at_death,proj ect_no_1983$death)~1) and I want to find the survival rate and confidence intervals at different

Re: [R] R

2004-11-01 Thread songj
Hi, Adaikalavan Ramasamy: Thanks your message. I installed R in our SunRay. It seems it is only commend line, could I run RGui in SunRay? Thanks. Have a good day. Yours Song You will need to get R working first before installing BioConductor packages. Please provide a more useful

[R] GLMM

2004-11-01 Thread clemens . tilke
Hello, I have a problem concerning estimation of GLMM. I used methods from 3 different packages (see program). I would expect similar results for glmm and glmmML. The result differ in the estimated standard errors, however. I compared the results to MASS, 4th ed., p. 297. The results from

Re: [R] GLMM

2004-11-01 Thread Prof Brian Ripley
On Mon, 1 Nov 2004 [EMAIL PROTECTED] wrote: I have a problem concerning estimation of GLMM. I used methods from 3 different packages (see program). You haven't really attributed the functions you use to particular packages. If this is glmm() from Jim Lindsey's packages then it was our

Re: [R] R

2004-11-01 Thread Adaikalavan Ramasamy
Rgui ? I think only Windows pre-compiled distribution has 'Rgui.exe' file but others in the list know better. I presume SunRay is the Sun Solaris 9.0 you mentioned below. If so, please try with R pre-compiled for the appropriate platform or build from the source. See

RE: [R] Obtaining fitted model information

2004-11-01 Thread John Fox
Dear Renaud, Thanks -- I forgot about the error variance! John John Fox Department of Sociology McMaster University Hamilton, Ontario Canada L8S 4M4 905-525-9140x23604 http://socserv.mcmaster.ca/jfox -Original

[R] non-linear solve?

2004-11-01 Thread ivo_welch-rstat8783
hi: could someone please point me to a function that allows me to solve general non-linear functions? irr.in - function(r, c1, c2, c3 ) { return(c1+c2/(1+r) + c3/(1+r)^2); } solve.nonlinear( irr.in, -100, 60, 70 ); 0.189 If someone has written an irr function, this would be helpful,

RE: [R] non-linear solve?

2004-11-01 Thread Liaw, Andy
See ?uniroot: uniroot(irr.in, c(-1, 1), c1=-100, c2=60, c3=70) $root [1] 0.1888196 $f.root [1] -1.514979e-05 $iter [1] 8 $estim.prec [1] 6.103516e-05 Warning message: NA/Inf replaced by maximum positive value Andy From: [EMAIL PROTECTED] hi: could someone please point me to a

Re: [R] non-linear solve?

2004-11-01 Thread Timur Elzhov
From: [EMAIL PROTECTED] Date: Tue 02 Nov 2004 - 00:55:31 EST hi: could someone please point me to a function that allows me to solve general non-linear functions? irr.in - function(r, c1, c2, c3 ) { return(c1+c2/(1+r) + c3/(1+r)^2); } solve.nonlinear( irr.in, -100, 60, 70 ); 0.189

[R] deleting specified NA values

2004-11-01 Thread Robert Brown FM CEFAS
I have a data set of about 1 records which was compiled from several smaller data sets using SPSS. During compilation 88 false records were accidentally introduced which comprise all NA values. I want to delete these records but not other missing data. The functions na.exclude and na.omit

RE: [R] deleting specified NA values

2004-11-01 Thread Liaw, Andy
This sort of things are most likely covered in `An Introduction to R': newDATA - DATA[!is.na(DATA$age),] Andy From: Robert Brown FM CEFAS I have a data set of about 1 records which was compiled from several smaller data sets using SPSS. During compilation 88 false records were

RE: [R] deleting specified NA values

2004-11-01 Thread Andy Bunn
I think you want something like so: # make some data foo.df - data.frame(x = 1:100, y = runif(100), age = rnorm(100, 10, 1)) # stick some real NAs in all columns foo.df[c(2,78,32,56),] - NA # make some errant NAs in the column age foo.df$age[c(99, 26, 75, 3)] - NA # eg foo.df[1:5,] # remove the

RE: [R] deleting specified NA values

2004-11-01 Thread BXC (Bendix Carstensen)
How about: all.nas - apply( old, 1, function(x) sum( is.na( x ) ) ) new - old[all.nas dim( old )[2], ] -- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06

RE: [R] deleting specified NA values

2004-11-01 Thread Ted Harding
On 01-Nov-04 Robert Brown FM CEFAS wrote: I have a data set of about 1 records which was compiled from several smaller data sets using SPSS. During compilation 88 false records were accidentally introduced which comprise all NA values. I want to delete these records but not other missing

Re: [R] deleting specified NA values

2004-11-01 Thread Gabor Grothendieck
BXC (Bendix Carstensen bxc at steno.dk writes: : : From: r-help-bounces at stat.math.ethz.ch : [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Robert : : I have a data set of about 1 records which was compiled : from several smaller data sets using SPSS. During

Re: [R] deleting specified NA values

2004-11-01 Thread Peter Dalgaard
Gabor Grothendieck [EMAIL PROTECTED] writes: BXC (Bendix Carstensen bxc at steno.dk writes: : : From: r-help-bounces at stat.math.ethz.ch : [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Robert : : I have a data set of about 1 records which was compiled : from

Re: [R] Compilation error on mgcv_1.1-7 on OS X (10.3)

2004-11-01 Thread Prof Brian Ripley
I expect your version of R was not compiled on your own system, although you don't say (please see the posting guide). (I also presume this is a Macintosh but you could have said.) The solutions are simple: 1) Compile R yourself -- the best choice. 2) Download a pre-compiled binary of that

Re: [R] Compilation error on mgcv_1.1-7 on OS X (10.3)

2004-11-01 Thread Paul Roebuck
On Mon, 1 Nov 2004, Jon Egil Strand wrote: I run into a compilation error when updating to mgcv_1.1-7 in R 2.0.0 on OS X 10.3. Note that other pacakges have compiled nicely. Some details are given below, but in short it looks like it's seeking for

Re: [R] Compilation error on mgcv_1.1-7 on OS X (10.3)

2004-11-01 Thread Simon Wood
ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2) does not exist ld: warning -L: directory name (/usr/local/lib/gcc/powerpc-apple-darwin6.8/3.4.2/../../..) does not exist ld: can't locate file for: -lfrtbegin make: *** [mgcv.so] Error 1 ERROR:

[R] Read in data from Microsoft SQL

2004-11-01 Thread Xiaorong Chen
Hi, I am trying to read data from Microsoft SQL. I tried to use odbcConnect (in RODBC) but failed. What should the dsn be? Does anyone know how to do it? I will appreciate it. Thank you! Xiaorong The preceding e-mail

[R] Reading word by word in a dataset

2004-11-01 Thread j lee
Hello All, I'd like to read first words in lines into a new file. If I have a data file the following, how can I get the first words: apple, banana, strawberry? i1-apple10$ New_York i2-banana 5$London i3-strawberry 7$Japan Is there any similar question already posted

[R] make apply() return a list

2004-11-01 Thread Arne Henningsen
Hi, I have a dataframe (say myData) and want to get a list (say myList) that contains a matrix for each row of the dataframe myData. These matrices are calculated based on the corresponding row of myData. Using a for()-loop to do this is very slow. Thus, I tried to use apply(). However, afaik

[R] suse 9.2 question

2004-11-01 Thread WAYNE KING
Hi all, I checked the archive and didn't see an anser to this. I updated to Suse 9.2 with kde 3.3 and the installed version of R (from the suse 9.1) rpms came up with the following failed dependencies (after querying the rpm) error: Failed dependencies: libg2c.so.0 is needed by

RE: [R] Reading word by word in a dataset

2004-11-01 Thread Liaw, Andy
Using R-2.0.0 on WinXPPro, cut-and-pasting the data you have: read.table(clipboard, colClasses=c(character, NULL, NULL)) V1 1 i1-apple 2 i2-banana 3 i3-strawberry HTH, Andy From: j lee Hello All, I'd like to read first words in lines into a new file. If I have a

Re: [R] make apply() return a list

2004-11-01 Thread Tony Plate
for()-loops aren't so bad. Look inside the code of apply() and see what it uses! The important thing is that you use vectorized functions to manipulate vectors. It's often fine to use for-loops to manipulate the rows or columns of a matrix, but once you've extracted a row or a column, then

Re: [R] make apply() return a list

2004-11-01 Thread Mahbub Latif
How about this... x = matrix(1:27, ncol=9, byrow=T) nr= nrow(x) lapply(1:nr, function(i) matrix(x[i,], nrow=3, byrow=T)) Mahbub. On Mon, 1 Nov 2004 19:37:08 +0100, Arne Henningsen [EMAIL PROTECTED] wrote: Hi, I have a dataframe (say myData) and want to get a list (say myList) that

Re: [R] suse 9.2 question

2004-11-01 Thread Uwe Ligges
WAYNE KING wrote: Hi all, I checked the archive and didn't see an anser to this. I updated to Suse 9.2 with kde 3.3 and the installed version of R (from the suse 9.1) rpms came up with the following failed dependencies (after querying the rpm) error: Failed dependencies:

Re: [R] make apply() return a list

2004-11-01 Thread Gabor Grothendieck
Arne Henningsen ahenningsen at email.uni-kiel.de writes: : : Hi, : : I have a dataframe (say myData) and want to get a list (say myList) that : contains a matrix for each row of the dataframe myData. These matrices are : calculated based on the corresponding row of myData. Using a for()-loop

Re: [R] Reading word by word in a dataset

2004-11-01 Thread Uwe Ligges
Liaw, Andy wrote: Using R-2.0.0 on WinXPPro, cut-and-pasting the data you have: read.table(clipboard, colClasses=c(character, NULL, NULL)) V1 1 i1-apple 2 i2-banana 3 i3-strawberry ... and if only the words after - are of interest, the statement can be followed by

[R] ms access -- mysql -- R in Linux

2004-11-01 Thread Anne York
I am trying to use some ms access databases in R (version 1.9.1 or 2.0 on a Debian system). In searching the net for promising software to do this, I found mdbtools. Mdbtools claims the ability to convert schemas and tables in MS Access to MySQL and other databases.

RE: [R] Reading word by word in a dataset

2004-11-01 Thread Andy Bunn
Something like this should work: foo - read.table(text2read.txt, colClasses=c(character, NULL, NULL))$V1 foo - gsub(i[0-9]-, , foo) HTH, Andy __ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Read in data from Microsoft SQL

2004-11-01 Thread Uwe Ligges
Xiaorong Chen wrote: Hi, I am trying to read data from Microsoft SQL. I tried to use odbcConnect (in RODBC) but failed. What should the dsn be? Does anyone know how to do it? I will appreciate it. The dsn is that one you have entered in the control panel before. (there you have to specify data

Re: [R] Error Message: MCMCpack and coda

2004-11-01 Thread Andrew D. Martin
Robin, This is a problem with coda's mcmc summary method. I suspect it is in the spectrum0() call therein, but I don't know for sure. For your immediate purposes you could extract the posterior density sample as a matrix from the mcmc object and manually compute quantities of interest. Best,

Re: [R] ms access -- mysql -- R in Linux

2004-11-01 Thread Prof Brian Ripley
mdbtools claims to have an ODBC driver, so no conversion should be necessary, just use RODBC. Both last time I tried and just now I could not get it to compile. The problems were in its Gtk front end, but that appears not to be optional. On Mon, 1 Nov 2004, Anne York wrote: I am trying to use

Re: [R] suse 9.2 question

2004-11-01 Thread Peter Dalgaard
Uwe Ligges [EMAIL PROTECTED] writes: WAYNE KING wrote: Hi all, I checked the archive and didn't see an anser to this. I updated to Suse 9.2 with kde 3.3 and the installed version of R (from the suse 9.1) rpms came up with the following failed dependencies (after querying the rpm)

[R] How to plot PDF which is in the form of orthogonal polynomial

2004-11-01 Thread Yong Wang
Dear all using the orthogonal polymial on a set of data, I get an approximate density which basically is in the form: exp(-polynomial), as you know, the parameters are the converged coeeficients. obviously, It is hard, if not impossible, to use the inverse CDF method to get a sample and then

Re: [R] Reading word by word in a dataset

2004-11-01 Thread Spencer Graves
Uwe and Andy's solutions are great for many applications but won't work if not all rows have the same numbers of fields. Consider for example the following modification of Lee's example: i1-apple10$ New_York i2-banana i3-strawberry 7$Japan If I copy this to clipboard

Re: [R] ms access -- mysql -- R in Linux

2004-11-01 Thread Marc Schwartz
On Mon, 2004-11-01 at 14:31, Mateusz Loskot wrote: 01.11 2004 r., on 19:14 Anne York wrote: I am trying to use some ms access databases in R (version 1.9.1 or 2.0 on a Debian system). In searching the net for promising software to do this, I found mdbtools. Mdbtools claims the ability

[R] overlapping plots

2004-11-01 Thread Carlisle Thacker
How to combine three plots so that they partially overlap? As the data on all three are near the left side and top, it would be nice to draw the first, shift axes down and to the right and draw the second, and shift again to draw the third. I could shift the data for the 2nd and 3rd plots and

RE: [R] Reading word by word in a dataset

2004-11-01 Thread Liaw, Andy
Don't give up on read.table() just yet: read.table(clipboard, colClasses=c(character, NULL, NULL), fill=TRUE) V1 1 i1-apple 2 i2-banana 3 i3-strawberry Andy From: Spencer Graves Uwe and Andy's solutions are great for many applications but won't work if not

Re: [R] Reading word by word in a dataset

2004-11-01 Thread Tony Plate
Trying to make it work when not all rows have the same numbers of fields seems like a good place to use the flush argument to scan() (to skip everything after the first field on the line): With the following copied to the clipboard: i1-apple10$ New_York i2-banana i3-strawberry 7$

RE: [R] overlapping plots

2004-11-01 Thread Liaw, Andy
I don't really understand what you want to do, but seems like with the `grid' package, such things are quite possible. Andy From: Carlisle Thacker How to combine three plots so that they partially overlap? As the data on all three are near the left side and top, it would be nice to draw

[R] plot time series / dates (basic)

2004-11-01 Thread bogdan romocea
Dear R users, I'm having a hard time with some very simple things. I have a time series where the dates are in the format 7-Oct-04. I imported the file with read.csv so the date column is a factor. The series is rather long and I want to plot it piece by piece. The function below works fine,

Re: [R] ms access -- mysql -- R in Linux

2004-11-01 Thread David Whiting
Anne York [EMAIL PROTECTED] writes: I am trying to use some ms access databases in R (version 1.9.1 or 2.0 on a Debian system). In searching the net for promising software to do this, I found mdbtools. Mdbtools claims the ability to convert schemas and tables in MS Access to MySQL and other

Re: [R] How to plot PDF which is in the form of orthogonal polynomial

2004-11-01 Thread Spencer Graves
Have you considered cumsum(exp(-polynomial))? Consider for example the following: library(polynom) b. - polynomial(1:5) x - seq(-2, 2, length=101) b.p - predict(b., x) plot(x, b.p) plot(x, exp(-b.p)) cdf - cumsum(exp(-b.p)) plot(cdf/cdf[101]) hope this helps. spencer graves

Re: [R] suse 9.2 question

2004-11-01 Thread Prof Brian Ripley
On 1 Nov 2004, Peter Dalgaard wrote: Uwe Ligges [EMAIL PROTECTED] writes: WAYNE KING wrote: Hi all, I checked the archive and didn't see an anser to this. I updated to Suse 9.2 with kde 3.3 and the installed version of R (from the suse 9.1) rpms came up with the following failed

Re: [R] ms access -- mysql -- R in Linux

2004-11-01 Thread David Whiting
Marc Schwartz [EMAIL PROTECTED] writes: [...] The issue at this point (among many I suspect) is that the mdbtools package is read-only to Access, though there are longer term plans to enable write functionality. So for the time being at least, there is no actual management ability to

[R] case-insensitive ZIP

2004-11-01 Thread Primer, Jeremy (FID)
A development note: In the function install.packages, it would be helpful to those of us who have atypical installations and install manually from ZIP files to have pkgnames - sub(\\.zip$, , pkgnames) replaced with pkgnames - sub(\\.zip$, , pkgnames, ignore.case = TRUE)

Re: [R] plot time series / dates (basic)

2004-11-01 Thread Prof Brian Ripley
On Mon, 1 Nov 2004, bogdan romocea wrote: Dear R users, I'm having a hard time with some very simple things. I have a time series where the dates are in the format 7-Oct-04. So why use as.POSIXct for a date, rather than as.Date? I imported the file with read.csv so the date column is a

Re: [R] ms access -- mysql -- R in Linux

2004-11-01 Thread David Whiting
David Whiting [EMAIL PROTECTED] writes: I'll have spend a little more time playing with this... Well, here's a simple start. There's more checking that needs to be done, but this makes the process a little more straight forward: mdbTables - function(dbname) { system(paste(mdb-tables -d

Re: [R] overlapping plots

2004-11-01 Thread partha_bagchi
Use a judicious combination of par(mai) and par(new = TRUE). For example: par(mai = c(3,1,1,1)) x - runif(50) plot(x, xlim = c(1, 500), ylim = c( -5, 1), bty = l) par(mai = c(2,1.5,2,1)) par(new = TRUE) x - runif(50) plot(x, xlim = c(1, 500), ylim = c( -5, 1), bty = l) par(mai = c(1,2,3,1))

Re: [R] suse 9.2 question

2004-11-01 Thread Peter Dalgaard
Prof Brian Ripley [EMAIL PROTECTED] writes: Well, yes, they will. Maybe not a compile problem, but otherwise. Not sure about libg2c, but without libreadline you definitely won't have command recall. But we are on libreadline.so.5 nowadays, so I suspect a very recent system like SuSE

Re: [R] Reading word by word in a dataset

2004-11-01 Thread Spencer Graves
Dear Andy Tony: That's great. Unfortunately, I still spend most of my life in the S-Plus world, and read.table in S-Plus 6.2 does not have the fill argument. However, Tony's solution (and my ugly hack) work in both S-Plus 6.2 and R 2.0.0. Thanks again. Spencer Graves

[R] stacking imported data

2004-11-01 Thread Sundar Dorai-Raj
Hi all, I have a question that I don't have a good answer for (note the word good; I have an answer, but I consider it not good). Take the following data in a single tab-delimited text file: text A Labels Value SE 2.5%97.5% R90 0.2317871.1480440.035074

[R] Questions 2.0.0

2004-11-01 Thread Javier Arsuaga
I have just installed R-2.0.0 in my LINUX redhat GNOME. have installed R in the / (top directory) I am having two problems: 1.- My graphics are gone (like x11() will not work) even if I install the library (grGraphics). 2.- The arrow keys to repeat commands are not working

[R] A general Mathematicasl pointer if you could? Thank you.

2004-11-01 Thread David H.
Greetings. A friend of mine and I are thinking about implementing the SIQ Protocol, describe as RFC here: http://www.milter.info/milter-siq/draft-irtf-asrg-iar-howe-siq-00.txt as an Apache Module. This would implement the HTTP connector described in the RFC. While we do not think that this is too

Re: [R] Questions 2.0.0

2004-11-01 Thread Prof Brian Ripley
On 1 Nov 2004, Javier Arsuaga wrote: I have just installed R-2.0.0 in my LINUX redhat GNOME. have installed R in the / (top directory) Did you install from sources, or from an RPM? If from sources, please check what the end of the configure step says and what the R-admin manual says about

Re: [R] Read in data from Microsoft SQL

2004-11-01 Thread Jan_Svatos
Hi, the DSN should be exactly the same as name of the (probably system) DSN stated in Windows ODBC settings. Just keep in mind, that DSN in general often holds information about the Default Database, and that switching database os stating database as prefix may be necessary. Jan - - -