[R] read.spss warning message (Unrecognized record type 7, subtype 18 encountered in system file)

2010-10-18 Thread Paul Miller
Hello Everyone,   Trying to help someone recover the contents of an SPSS.sav file using read.spss. This seemed to work well but produced a warning message. My code and the warning are displayed below.   Spent some time looking for previous questions about this warning. Found a lot of questions

[R] Mixed Conditional Logit with nested data

2010-07-16 Thread Paul Miller
Hello Everyone,   This is my first attempt to do something in R. As a precursor to a Willingness to Pay analysis, I want to conduct a Mixed Conditional Logit analysis but am unsure how to proceed because of some nesting within my data.   Below is some data and code that illustrate what I’m

[R] R Equivalent of SAS Datastep Line-Hold (@@) Specifier?

2010-07-29 Thread Paul Miller
Hello Everyone,   Below is some SAS code that uses a line hold specifier to read multiple observations from each of several input lines of data. There are 3 patients per line in the in-stream data.   Is there a way in R to read this kind of data? I've looked in my books and online but haven't

Re: [R] R Equivalent of SAS Datastep Line-Hold (@@) Specifier?

2010-07-30 Thread Paul Miller
   A      1     111   F  69    70 Rather than use a textConnection, you would probably just use a file. -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Joshua Wiley Sent: Friday, 30 July 2010 4:59 PM To: Paul Miller Cc: r-help@r

[R] Using McNemar's test to detect shifts in response from pre- to post-treatment

2010-09-14 Thread Paul Miller
Hello Everyone,   I've been asked to check if there is a significant difference in the following:     Pre    Post Group A 15/19 14/19 Group B 14/19 10/19   My sense is that I need to perform McNemar's test on these data because responses are correlated within

[R] Sample size estimation for non-inferiority log-rank and Wilcoxon rank-sum tests

2010-09-27 Thread Paul Miller
Hello Everyone,   I'm trying to conduct a couple of power analyses and was hoping someone might be able to help. I want to estimate the sample size that would be necessary to adequately power a couple of non-inferiority tests. The first would be a log-rank test and the second would be a

[R] How many R packages are not free?

2010-10-01 Thread Paul Miller
Hello Everyone,   Just finished reading A Handbook of Statistical Analyses using R by Everitt and Hothorn. I'll begin by saying that I quite liked the book. It's both little and mighty in the sense that it's very compact but contains a tremendous amount of useful material.   The last chapter of

Re: [R] How many R packages are not free?

2010-10-04 Thread Paul Miller
Thanks to everyone who replied to my post. One person indicated that this question treads on dangerous terrain. I had that sense too but really wanted to know how many packages might not be free in the sense that they could be used at no cost by everyone. I was a little disappointed to learn

[R] Does sink stand for anything?

2010-04-15 Thread Paul Miller
Hello Everyone,   Learning about R and its wonderful array of functions. If it's not obvious, I usually try to find out what a function stands for. I think this helps me remember better.   One function that has me stumped is sink. Can anyone tell me if this stands for something?   Thanks,  

[R] R and S-Plus: Two programs separated by a common language?

2010-04-22 Thread Paul Miller
Hello Everyone,   My company purchased S-Plus before it was bought out by Tibco. My understanding is that we own version 7.0 outright.   So far, I've been learning in R but thought I might also try working in S-Plus. My understanding is that S-Plus has some useful extra features. Another

[R] SPLUS Seqtrial vs. R Packages for sequential clinical trials designs

2009-12-17 Thread Paul Miller
Hello Everyone,   I’m a SAS user who has recently become interested in sequential clinical trials designs. I’ve discovered that the SAS based approaches for these designs are either too costly or are “experimental.” So now I’m looking for alternative software. Two programs that

[R] Using discrete choice data to estimate marginal willingness to pay (MWTP)

2010-03-03 Thread Paul Miller
Hello Everyone,   Can anyone show me how to use discrete choice data to estimate marginal willingness to pay? I've searched for simple information or code on how to do this but haven't found much.   The closest I've come is a paper titled Introduction to Choice Experiments using R. The paper

[R] How good is R at making publication quality tables?

2010-03-17 Thread Paul Miller
Hello Everyone,   I have just started learning R and am in the process of figuring out what it can and can't do. I must say I am very impressed with R so far and am amazed that something this good can actually be free.   Recently, I finished reading R for SAS and SPSS Users and have begun

Re: [R] How good is R at making publication quality tables?

2010-03-18 Thread Paul Miller
Hello Everyone,   At last count, I had 14 responses to my question. Thanks very much to everyone who replied, for helping me to understand that R is in fact capable of making publication quality tables and is very flexible in rendering these outputs. I'm still working my way through some of the

[R] Reading SQL Server Tables using RODBC

2010-03-25 Thread Paul Miller
Hello Everyone,   I'm still quite new to R and am having trouble reading SQL Server Tables using RODBC. I've looked though the RODBC documentation as well as material I found online and in the book Data Manipulation with R, but I just can't quite seem to get things to work.   Right now, I have

[R] Reading SQL Server Tables using RODBC (Got it!)

2010-03-25 Thread Paul Miller
Thanks to those who responded to my post about reading SQL server tables using RODBC. Someone in our IT department sent me a link that contained the following information:   SQL ODBC connection strings Standard Security: br Driver={SQLServer};Server=Your_Server_Name;Database=

[R] Reading dates in R using SQL and otherwise (and some interesting behavior by the data editor)

2010-04-08 Thread Paul Miller
Hello Everyone,   I am a newbie with about a month's worth of experience using R. I've just spent a little time learning how to work with date values. Mostly, this has involved converting text values into dates.   So far, I've managed to figure out how to do this in R proper using as.Date.

Re: [R] Reading dates in R using SQL and otherwise (and someinteresting behavior by the data editor)

2010-04-08 Thread Paul Miller
Hi Paul, Jim, Dennis, and others,   I got RODBC and SQL Server to create a date variable in R (see below). I'm pretty sure the commands I was issuing before were working but that I was stripping off the date class every time I submitted the command fix(mydata). So I kept getting the mistaken

[R] Multiple endpoint (possibly group sequential) sample size calculation

2011-08-04 Thread Paul Miller
Hello everyone, I need to do a sample size calculation. The study two arms and two endpoints. The two arms are two different cancer drugs and the two endpoints reflect efficacy (based on progression free survival) and toxicity. Until now, I have been trying to understand this in terms of a

Re: [R] Multiple endpoint (possibly group sequential) sample size calculation

2011-08-05 Thread Paul Miller
Thanks for your reply Marc. I'll look into the information you sent. It ocurred to me that I could have done a better job of describing what I'm trying to do. It can be difficult to do that sometimes when your unfamiliar with a topic and are still trying to figure it out yourself. In

[R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
Hello All,   Recently, I discovered that there are appear to be some good R related books that don't have R in the title. For example, I'm currently reading Gellman and Hill's book Data Analysis using Regression and Multilevel/Hierarchical Models. The book uses R (and BUGS) but doesn't appear

Re: [R] What's your favourite R book that doesn't have R in the title?

2011-08-16 Thread Paul Miller
I can add one more title. The foundations of statistics: A simulation-based approach by Vasishth and Broe. Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Cox Proportional Hazards model with a time-varying covariate

2011-03-31 Thread Paul Miller
Hello Everyone,   I'm learning how to perform various statistical analyses in R. I'm checking my understanding by replicating examples from my SAS books. Below is an attempt to replicate a Cox Proportional Hazards model with a time-varying covariate. I think I'm doing this correctly but am not

Re: [R] Cox Proportional Hazards model with a time-varying covariate

2011-04-01 Thread Paul Miller
Hi Terry and Kevin,   Thanks for your replies to my post. And thanks particularly to Terry for pointing out my confusion about the exact partial likelihood vs. the exact marginal likelihood. I'm learning and so am likely to be confused about such things from time to time.   I had thought

[R] Test email: Please disregard

2011-04-20 Thread Paul Miller
Having trouble posting. Thought it might have something to do with the particular message I'm sending. Sending this message to test that possibility. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] Test email #2: Please ignore

2011-04-20 Thread Paul Miller
Having trouble posting. This is a second test email to help determine if the problem has been resolved. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Sample Size Calculation using a Drop the Loser/Keep the Winner Design

2011-09-26 Thread Paul Miller
Hello Everyone,   I need to perform a sample size calculation using a drop the loser/keep the winner design. I've been searching for examples of how to do this using R but haven't found much.   The most promising possibility thus far is an R function called DrpLsrNRst. This appears in the book

[R] Coalesce function in BBmisc, emoa, and microbenchmark packages

2012-03-17 Thread Paul Miller
Hello All, Need to coalesce some columns using R. Looked online to see how this is done. One approach appears to be to use ifelse. Also uncovered a coalesce function in the BBmisc, emoa, and microbenchmark packages. Trouble is I can't seem to get it to work in any of these packages. Or perhaps

Re: [R] Coalesce function in BBmisc, emoa, and microbenchmark packages

2012-03-17 Thread Paul Miller
Hi Michael, So the coalesce functions don't do what I thought they did. I'll just use ifelse() then unless anyone makes it clear I should do something different. Thanks, Paul __ R-help@r-project.org mailing list

Re: [R] Coalesce function in BBmisc, emoa, and microbenchmark packages

2012-03-20 Thread Paul Miller
Hi Brian, This works very well. Still trying to develop some skill with R. So can't say I understand your function completely as yet, but will work on it. I had thought that your function might only work for two columns (because of the function(x,y) part), but the example below suggests it

[R] Reshaping data from long to wide without a timevar

2012-03-20 Thread Paul Miller
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a timevar. I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My

Re: [R] Reshaping data from long to wide without a timevar

2012-03-20 Thread Paul Miller
To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Tuesday, March 20, 2012, 9:01 AM If I understand you right, library(reshape2) dcast(melt(TestData, id.var = Subject, measure.var = Drug), Subject ~ value) Michael On Tue, Mar 20, 2012 at 9:50 AM, Paul Miller

Re: [R] Reshaping data from long to wide without a timevar

2012-03-21 Thread Paul Miller
Hello All, Tried some more Internet searches and came to the conclusion that one probably does need to create a timevar before reshaping from long to wide. Below is some code that creates the timevar and transposes the data. connection - textConnection( 005 1 Gemcitabine 005 2 Erlotinib 006 1

[R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-22 Thread Paul Miller
Hello All, Want very much to learn how to plot patient drug timelines. Trouble is I need to figure out how to do this today. So not much time for me to struggle with it. Hoping someone can just help me out a bit. Below are some sample data and code that produces what I think is the beginning

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-22 Thread Paul Miller
them? Thanks, Paul --- On Thu, 3/22/12, Bert Gunter gunter.ber...@gene.com wrote: From: Bert Gunter gunter.ber...@gene.com Subject: Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-22 Thread Paul Miller
patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Thursday, March 22, 2012, 12:55 PM Inline: On Thu, Mar 22, 2012 at 1:41 PM, Paul Miller pjmiller...@yahoo.com wrote: Hello All, Want very much

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-22 Thread Paul Miller
michael.weyla...@gmail.com Subject: Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Thursday, March 22, 2012, 4:11 PM On Thu, Mar 22, 2012 at 4:47 PM, Paul Miller pjmiller...@yahoo.com

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-22 Thread Paul Miller
Hi Michael, This may be an ugly way of doing things but the title = unique(paste( ... bit in the code below automates the code for pattern, patient, and line. So now all I'd need is the looping part. If good ways of automating the code for pattern, patient, and line or of doing the looping

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-23 Thread Paul Miller
Hi Michael, Added a little more to my code (see below). It now automatically sets the name of the file. It also does a better job of spacing the text for pattern and patient x line at the top of the graph. I really like the way this looks now. I just need to figure out how to loop through the

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-23 Thread Paul Miller
--- On Fri, 3/23/12, R. Michael Weylandt michael.weyla...@gmail.com wrote: From: R. Michael Weylandt michael.weyla...@gmail.com Subject: Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-23 Thread Paul Miller
the last day or so. Paul --- On Fri, 3/23/12, R. Michael Weylandt michael.weyla...@gmail.com wrote: From: R. Michael Weylandt michael.weyla...@gmail.com Subject: Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-27 Thread Paul Miller
: David Winsemius dwinsem...@comcast.net Subject: Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!! To: Paul Miller pjmiller...@yahoo.com Cc: R. Michael Weylandt michael.weyla...@gmail.com, Petr PIKAL petr.pi...@precheza.cz, Bert Gunter gunter.ber...@gene.com

Re: [R] Plotting patient drug timelines using ggplot2 (or some other means) -- Help!!!

2012-03-28 Thread Paul Miller
Hello All, Figured out how to get the gaps in the bars when a drug stops and the starts again (see below). Made the graph overlaid/superimposed/stacked and got the desired result. Not sure this is how an expert would do it. But it's simple and it works. Paul setwd(N:/Regimen

[R] Adding text for written comments to bottom of graphs

2012-03-30 Thread Paul Miller
Hello All, Recently developed the code below for graphing patterns of chemotherapy administration. As someone just starting to use R in their work, I managed to figure out some parts of the code but needed help with others. setwd(N:/Regimen Coding/0906/Plots Test) getwd() TestData -

Re: [R] Adding text for written comments to bottom of graphs

2012-03-31 Thread Paul Miller
Hello Baptiste, What you've done is very interesting. Went through and tried to understand all the steps. Reminded me of studying languages in years gone by. Always found it easier to read and understand a sentence than to construct a sentence of one's own. This is particularly true when

Re: [R] Adding text for written comments to bottom of graphs

2012-04-06 Thread Paul Miller
Hi Baptiste, Thanks for your help with this. Sorry for being slow to express my appreciation. I had intended to put some more time into tweaking the graphs before responding. Recently have been reading Hadley Wickham's ggplot2 book and have also located some materials on the knitr package.

[R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
    Hello Everyone,   I'm trying to use SAS to replicate some results obtained in R. I was wondering if anyone call tell me the SAS equivalent of the code that appears below.   fm.glm.x - glm(resp ~ . - 1, data = as.data.frame(mm.x),  na.action = na.exclude, family = binomial(link = probit))

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
Subject: Re: [R] What is the SAS equivalent of this R glm() code? To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Friday, December 3, 2010, 3:55 PM ummm... This is an R list. Shouldn't you be posting this query on a SAS list? -- Bert (and why would you want to do this anyway

Re: [R] What is the SAS equivalent of this R glm() code?

2010-12-03 Thread Paul Miller
: From: peter dalgaard pda...@gmail.com Subject: Re: [R] What is the SAS equivalent of this R glm() code? To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Friday, December 3, 2010, 4:15 PM On Dec 3, 2010, at 22:42 , Paul Miller wrote:     Hello Everyone,   I'm trying

[R] LaTeX, MiKTeX, LyX: A Guide for the Perplexed

2010-12-07 Thread Paul Miller
Hello Everyone,   Been learning R over the past several months. Read several books and have learned a great deal about data manipulation, statistical analysis, and graphics.   Now I want to learn how to make nice looking documents and about literate programming. My understanding is that R

Re: [R] LaTeX, MiKTeX, LyX: A Guide for the Perplexed

2010-12-16 Thread Paul Miller
Hello Everyone,   Thanks to all who replied to my earlier message. I got quite a few responses and several suggestions about how to create nice looking documents that incorporate output from R. It took some time to investigate these, and in some ways I'm more perplexed than when I started.  

[R] Code for The R Book

2010-12-16 Thread Paul Miller
Hello Everyone,   Does anyone have the R code for this book? I contacted the author about this and was told that it used to be on the book's website, but that the publisher had asked that it be taken down. I'm hoping that someone will have downloaded the code when it was available, and that

Re: [R] Code for The R Book

2010-12-16 Thread Paul Miller
To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Thursday, December 16, 2010, 2:52 PM Hello, You can find the code here: http://www.bio.ic.ac.uk/research/mjcraw/therbook/index.htm Regards, Carlos Ortega. On Thu, Dec 16, 2010 at 9:31 PM, Paul Miller pjmiller

[R] Seeking feedback on my first attempt at R programming

2010-12-22 Thread Paul Miller
Hello Everyone,   Below is my first attempt at R programming. The code replicates example 5.1 from Common Statistical Methods for Clinical Research with SAS Examples. I was hoping that people more experienced than myself would be willing to take a look and let me know what I did well and what

Re: [R] Seeking feedback on my first attempt at R programming

2010-12-24 Thread Paul Miller
Hi Gabor,   Thanks very much for your reply. I was hoping to ask a follow-up question. Can you explain why it's better to use transform than to use within? The main difference between the two functions seems to be that within allows one to use variables created in a step (e.g., A and B) to

[R] Problem working with dates

2011-11-07 Thread Paul Miller
Hello All, I've been reading books about R for awhile now and am in the process of replicating the SAS analyses from an old report. I want to be sure that I can do all the things I need to in R before using it in my daily work. So far, I've managed to read in all my data and have done some

Re: [R] Problem working with dates

2011-11-07 Thread Paul Miller
Hi Michael and David, Thank you both for your reply to my question. Problem solved. I'm finding that my level of success with R is a little uneven thus far. I'm sometimes surprised by the things I can do, but then am even more surprised by the simple things I struggle with. Appreciate your

[R] Checking dates for entry errors

2012-01-11 Thread Paul Miller
Hello Everyone,   I have a question about how best to check dates for entry errors. I recently discovered that R will read the incorrectly entered date 11/23/21931 without producing a warning or an error message at least under some circumstances.   as.Date(11/23/21931, format = %m/%d/%Y) [1]

[R] Checking for invalid dates: Code works but needs improvement

2012-01-24 Thread Paul Miller
Hello Everyone, Still new to R. Wrote some code that finds and prints invalid dates (see below). This code works but I suspect it's not very good. If someone could show me a better way, I'd greatly appreciate it. Here is some information about what I'm trying to accomplish. My sense is that

Re: [R] R-help Digest, Vol 107, Issue 25

2012-01-26 Thread Paul Miller
], \n) } Rui Barradas Message: 53 Date: Tue, 24 Jan 2012 08:54:49 -0800 (PST) From: Paul Miller pjmiller...@yahoo.com To: r-help@r-project.org Subject: [R] Checking for invalid dates: Code works but needs improvement Message-ID: 1327424089.1149.yahoomailclas...@web161604.mail.bf1.yahoo.com

[R] Checking for invalid dates: Code works but needs improvement

2012-01-26 Thread Paul Miller
for several arguments and (very) simple formating. { cat(Error: Invalid date values in, DateNames[[i]], \n, TestDates[DateNames][[i]][TestDates$Invalid==1], \n) } Rui Barradas Message: 53 Date: Tue, 24 Jan 2012 08:54:49 -0800 (PST) From: Paul Miller pjmiller...@yahoo.com To: r-help@r

[R] Checking for invalid dates: Code works but needs improvement

2012-01-30 Thread Paul Miller
Hi Rui, Marc, and Gabor, Thanks for your replies to my question. All were helpful and it was interesting to see how different people approach various aspects of the same problem. Spent some time this weekend looking at Rui's solution, which is certainly much clearer than my own. Managed to

[R] Using 2SLS to mimic SEM with nested data

2012-01-31 Thread Paul Miller
Hello Everyone, I am familiar with the use of 2SLS to mimic SEM. I even used this approach once to estimate a model with a latent interaction term. Does anyone know how to extend this approach to nested data? I have cancer patients with measures of cancer symptoms, functional impairment, and

Re: [R] Checking for invalid dates: Code works but needs improvement

2012-02-01 Thread Paul Miller
Hi Marc, That the code I wrote initially is over engineered is certainly possible. Of course, Rui's solution is a reworking of that code. If starting from scratch, Rui likely would have done something quite different. I focused on Rui's code because it was complete and was a clear improvement

Re: [R] Checking for invalid dates: Code works but needs improvement

2012-02-04 Thread Paul Miller
Hi David and Rui, Sorry to be so slow in replying. Thank you both for pointing out that the problem with my code was that I was using comparison operators on mixed data types. This is something I'll have to be more careful about in the future. In an earlier email, David talked about how R can

[R] Question about measurment invariance in a multigroup SEM

2012-02-09 Thread Paul Miller
Hello All, I have a question about measurement invariance in a multigroup SEM. I am of the impression that one cannot test the equality of structural paths across groups without demonstrating measurement invariance of latent factors first. At a minimum, this would involve demonstrating that

[R] Setting up counting process data for survival analysis

2011-06-13 Thread Paul Miller
Hello Everyone, I'm learning to do survival analysis in R using a time-varying covariate. I've managed to set up my data correctly using SAS and then to get the correct result using R. What I'd like help with is getting the data set up correctly in R without having to resort to using SAS.

[R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread Paul Miller
Hello All, Have recently started learning Sweave and Knitr. Am now trying to learn odfWeave as well. Things went pretty smoothly with Sweave and Knitr but I'm having some trouble with odfWeave. My understanding was that odfWeave should work in pretty much the same way as Sweave. With

Re: [R] odfWeave: Trouble Getting the Package to Work

2013-02-18 Thread Paul Miller
Kuhn mxk...@gmail.com Subject: Re: [R] odfWeave: Trouble Getting the Package to Work To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org r-help@r-project.org Received: Monday, February 18, 2013, 8:47 AM That's not a reproducible example. There is no sessionInfo() and you omitted code

Re: [R] odfWeave: Trouble Getting the Package to Work

2013-02-20 Thread Paul Miller
Hi Max,   It works! Updating the odfWeave and xml software did the trick. Thanks very much for your help.   Paul [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] How can I get this function to work?

2012-05-31 Thread Paul Miller
Hello All, Can anyone tell help me understand why the function below doesn't work and how I can fix it? Below are some sample data, some code that works on individual rows of the data, and my attempt to translate that code into a function. My hope is to get the function working and then to

Re: [R] How can I get this function to work?

2012-06-01 Thread Paul Miller
Hello Bert and Sarah, Thank you for your replies. Helped me understand how people might perceive my question and why they might not respond. Spent some time learning about R's debugging tools this morning. Began to realize why my function didn't work. My second argument was the name of a

Re: [R] How can I get this function to work?

2012-06-01 Thread Paul Miller
Hi Sarah, That I was making things too complicated doesn't surprise me. A skilled programmer makes everything look easy I think. And someone who is still learning does just the opposite. Am going to spend some time now looking through your tweaks. Thank you very much for your help. Paul

[R] Power analysis for Cox regression with a time-varying covariate

2012-07-13 Thread Paul Miller
Hello All, Does anyone know where I can find information about how to do a power analysis for Cox regression with a time-varying covariate using R or some other readily available software? I've done some searching online but haven't found anything. Thanks, Paul

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-15 Thread Paul Miller
start out using the steps you've listed and see where that takes me.   Paul   --- On Fri, 7/13/12, Greg Snow 538...@gmail.com wrote: From: Greg Snow 538...@gmail.com Subject: Re: [R] Power analysis for Cox regression with a time-varying covariate To: Paul Miller pjmiller...@yahoo.com Cc: r-help

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-18 Thread Paul Miller
for Cox regression with a time-varying covariate To: Marc Schwartz marc_schwa...@me.com, Greg Snow 538...@gmail.com, r-help@r-project.org, Paul Miller pjmiller...@yahoo.com Received: Wednesday, July 18, 2012, 8:24 AM Marc gave the referencer for Schoenfeld's article.  It's actually quite simple

[R] Text mining? Text manipulation? Both? Predicting KRAS test results in cancer patients

2012-09-28 Thread Paul Miller
Happy Friday Everyone,   Hope Friday afternoon doesn't turn out to be a terrible time to post a question. I've been doing a little data mining of patient text medical records as of late. I started out trying to predict whether or not cancer patients had received KRAS mutation testing and did

[R] SEM validation: Cross-Validation vs. Bootstrapping

2012-11-01 Thread Paul Miller
Hello All, Recently, I was asked to help out with an SEM cross-validation analysis. Initially, the project was based on sample-splitting where half of cases were randomly assigned to a training sample and half to a testing sample. Attempts to replicate a model developed in the training sample

Re: [R] SEM validation: Cross-Validation vs. Bootstrapping

2012-11-02 Thread Paul Miller
Hi Joshua, Thanks for your very helpful reply. I took a look at your mediation tutorial, MplusAutomation, and semutils. I may not need any of this for the current project, but it was very interesting and I could imagine using it in the future. I also looked at the Hastie, Tibshirani, Friedman

[R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Paul Miller
Hello All, Hope people won't mind my posting a LaTeX question here. I know a lot of people who use R are also using LaTeX. I'm in a bit of a rush to complete a document and am having trouble with one aspect of the formatting. I'm creating a list of tables using: \listoftables I also have

Re: [R] A LaTeX question -- Hope people won't mind

2012-08-20 Thread Paul Miller
...@me.com wrote: From: Marc Schwartz marc_schwa...@me.com Subject: Re: [R] A LaTeX question -- Hope people won't mind To: Paul Miller pjmiller...@yahoo.com Cc: r-help@r-project.org Received: Monday, August 20, 2012, 3:27 PM On Aug 20, 2012, at 3:13 PM, Paul Miller pjmiller...@yahoo.com wrote

[R] Analysis of censored cost data

2014-04-23 Thread Paul Miller
Hello All, Am intested in using R to analyze censored cost data. Looks like I'd need to estimate some means and associated variances. I've got a few papers describing this. These talk about the use of re-weighted estimators (Lin), inverse probability weighted estimators (Bang-Tsiatis),

Re: [R] Retain last grouping after a strsplit()

2012-12-12 Thread Paul Miller
Hi Steven, Not sure if you want to understand regular expressions in general or just the solution to your particular problem. If it's the former and you'd be willing to read a book on the subject, I'd recommend Mastering Regular Expressions by Jeffrey Friedl. I'm about halfway through now, and

[R] Pairwise T-Tests and Dunnett's Test (possibly using multcomp)

2011-03-01 Thread Paul Miller
Hello Everyone,   I've been learning to use R in my spare time over the past several months. I've read about 7-8 books on the subject. Lately I've been testing what I've learned by trying to replicate the analyses from some of my SAS books. This helps me make sure I know how to use R properly

[R] Pairwise T-Tests and Dunnett's Test (possibly using multcomp)

2011-03-01 Thread Paul Miller
Hello Everyone,   Figured out one part of the code. Setting the reference level for a factor is accomplished using the relevel funtion (pg. 383 of MASS; pg. 70 of Data Manipulation with R):   gad$dosegrp - relevel(gad$dosegrp,3)   This works very well. Much better than using a format in SAS

Re: [R] Pairwise T-Tests and Dunnett's Test (possibly using multcomp)

2011-03-03 Thread Paul Miller
Hi Josh,   Thanks for your reply. You're right about letting R's method dispatch system choose the method for summary and inserting more spaces in the code. I was just messing around with the code in the former case and forgot to change it back. As far as not having enough whitespace goes, I've

[R] Converting matrix to data frame without losing an assigned dimname

2013-04-09 Thread Paul Miller
Hello All, Would like to be able to convert a matrix to a dataframe without losing an assigned dimname. Here is an example that should illustrate what I'm talking about. tableData - state.x77[c(7, 38, 20, 46), c(7, 1, 8)] names(dimnames(tableData)) - c(State, ) tableData State Frost

Re: [R] Converting matrix to data frame without losing an assigned dimname

2013-04-10 Thread Paul Miller
Hi David, Gabor, Arun, and Rolf,   Thanks for your replies to my question. Very interesting and very helpful. I particularly liked the one-line solutions proposed by David and Gabor. I had a suspicion that this conversion could be done using only a minimal amount of code.   For what I'm doing, 

[R] Table with n(%) formatting: A better way to do this?

2013-04-10 Thread Paul Miller
Hello All, Am learning to create tables with n(%) formatting using R. Below is a working example. I think this is not bad but wondered if there are better ways of doing it. Although it can be quite humbling, seeing good code helps me assess my progress as an R programmer. Ultimately want to

Re: [R] Table with n(%) formatting: A better way to do this?

2013-04-11 Thread Paul Miller
Hello Dr. Murdoch, Thanks for your reply. Your tables package is interesting. Spent some time experimenting with it yesterday and it looks like something I can use. The n(%) format seems to be the standard for what I'm doing. So I can't directly use the output your package produces. It does

[R] odfWeave: Some questions about potential formatting options

2013-04-11 Thread Paul Miller
Hello All, Learning to use the odfWeave package. I really like the package. It has good documentation, makes some very nice looking tables, and seems to have lots of options for customizing output. There are a few things I'd like to do that don't seem to be covered in the documentation

[R] Convert results from print(survfit(formula, ...)) into a matrix or data frame

2013-04-15 Thread Paul Miller
Hello All, Below is some sample survival analysis code. I'd like to able to get the results from print(gehan.surv) into a matrix or data frame, so I can manipulate them and then create a table using odfWeave. Trouble is, I'm not quite sure how make such a conversion using the results from a

Re: [R] Convert results from print(survfit(formula, ...)) into a matrix or data frame

2013-04-15 Thread Paul Miller
Hi Marc, Oh, yes. That is quite simple. Silly me for not recognizing this. Thanks very much for your help. Paul __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] odfWeave: Some questions about potential formatting options

2013-04-16 Thread Paul Miller
Hi Milan and Max, Thanks to each of you for your reply to my post. Thus far, I've managed to find answers to some of the questions I asked initially. I am now able to control the justification of the leftmost column in my tables, as well as to add borders to the top and bottom. I also

Re: [R] odfWeave: Some questions about potential formatting options

2013-04-22 Thread Paul Miller
Bouchet-Valat nalimi...@club.fr Subject: Re: [R] odfWeave: Some questions about potential formatting options To: Paul Miller pjmiller...@yahoo.com Cc: Max Kuhn mxk...@gmail.com, r-help@r-project.org Received: Wednesday, April 17, 2013, 11:17 AM Le mardi 16 avril 2013 à 10:15 -0700, Paul Miller a écrit

[R] Trouble Computing Type III SS in a Cox Regression using drop1 and Anova

2013-04-24 Thread Paul Miller
Hello All, Am having some trouble computing Type III SS in a Cox Regression using either drop1 or Anova from the car package. Am hoping that people will take a look to see if they can tell what's going on. Here is my R code: cox3grp - subset(survData, Treatment %in% c(DC, DA, DO), c(PTNO,

Re: [R] Trouble Computing Type III SS in a Cox Regression

2013-04-25 Thread Paul Miller
wrote: From: Terry Therneau thern...@mayo.edu Subject: Re: Trouble Computing Type III SS in a Cox Regression To: r-help@r-project.org, Paul Miller pjmiller...@yahoo.com Received: Wednesday, April 24, 2013, 5:55 PM I should hope that there is trouble, since type III is an undefined concept

Re: [R] Trouble Computing Type III SS in a Cox Regression

2013-04-26 Thread Paul Miller
III SS in a Cox Regression To: Paul Miller pjmiller...@yahoo.com, r-help@R-project.org Received: Thursday, April 25, 2013, 10:40 AM You've missed the point of my earlier post, which is that type III is not an answerable question.    1. There are lots of ways to compare Cox models, LRT

[R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-13 Thread Paul Miller
Hello All,   Am replicating in R an analysis I did earlier using SAS. See this as a test of whether I'm ready to start using R in my day-to-day work.   Just finished replicating a Kaplan Meier analysis. Everything seems to work out fine except for one thing. The 95% CI around my estimate for the

Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-13 Thread Paul Miller
Hi Enrico, Not sure how SAS builds the CI but I can look into it. The SAS documentation does have a section on computational formulas at: http://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_lifetest_a000259.htm Although I can't provide my dataset, I can

  1   2   >