[R] confidence interval for logistic joinpoint regression from package ljr

2010-11-30 Thread moleps
I´m trying to run a logistic joinpoint regression utilising the ljr package. I´ve been using the forward selection technique to get the number of knots for the analysis, but I´m uncertain as to my results and the interpretation. The documentation is rather brief ( in the package and the stats

[R] coef(summary) and plyr

2010-08-09 Thread moleps
Dear all, I´m having trouble getting a list of regression variables back into a dataframe. mydf - data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100)) mydf$fac-factor(sample((0:2),replace=T,100)) mydf$y- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100) dlply(mydf,.(fac),function(df)

Re: [R] coef(summary) and plyr

2010-08-09 Thread moleps
: On Aug 9, 2010, at 7:51 AM, moleps wrote: Dear all, I´m having trouble getting a list of regression variables back into a dataframe. mydf - data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100)) mydf$fac-factor(sample((0:2),replace=T,100)) mydf$y- mydf$x1+0.01+mydf$x2*3-mydf$x3*19

Re: [R] coef(summary) and plyr

2010-08-10 Thread moleps
a-colnames(lo) b-rownames(lo) c-length(a) e-character(0) r-NULL for (x in (1:c)){ d-rep(paste(a[1:c],b[x],sep= )) e-paste(c(e,d)) t-lo[x,] r-c(r,t) names(r)-e } return(r) } ldply(dl,function(x) test(x))-g g Regards, Moleps On 9. aug. 2010

Re: [R] coef(summary) and plyr

2010-08-10 Thread moleps
correction... Col and rows were mixed up and loop only worked when rows were less than or equal to number of columns //M test-function(a){ coef(summary(a))-lo a-colnames(lo) b-rownames(lo) c-length(a) e-character(0) r-NULL for (x in (1:length(b))){

[R] Multiple imputation and matching

2010-08-20 Thread moleps
Dear all, Is it possible to impute a dataset and create a summary table with summary from Hmisc and convert it to latex? I´m mostly familiar with cem and amelia hence the example from the documentation in cem. The imbalance command is not exactly what I was looking for... library (cem)

[R] accessing the attr(*,label.table) after importing from spss

2010-08-25 Thread moleps
Dear all, I just received a file from a colleague in spss. The read.spss could not finish the file due to an error (Unrecognized record type 7, subtype 18 encountered in system file) so instead I converted the file using stat-transfer. Looking at my data I see that most labels are in the

Re: [R] accessing the attr(*, label.table) after importing from spss

2010-08-26 Thread moleps
],labels=names(a[[i]])) } } tre Regards, //M On 25. aug. 2010, at 23.05, Bert Gunter wrote: ?attr ?attributes -- Bert Gunter On Wed, Aug 25, 2010 at 1:26 PM, moleps mole...@gmail.com wrote: Dear all, I just received a file from a colleague in spss. The read.spss could

[R] glm prb (Error in `contrasts-`(`*tmp*`, value = contr.treatment) : )

2010-08-29 Thread moleps
glm(A~B+C+D+E+F,family = binomial(link = logit),data=tre,na.action=na.omit) Error in `contrasts-`(`*tmp*`, value = contr.treatment) : contrasts can be applied only to factors with 2 or more levels however, glm(A~B+C+D+E,family = binomial(link = logit),data=tre,na.action=na.omit) runs fine

[R] summary in Hmisc and Latex

2010-08-31 Thread moleps
Dear all, With the latest update of Hmisc I no longer have any problems with latex. However using the ctable option produces latex code that at least on both the miktex distribution at work and mactex distribution at home refuses to run due to an extra blank line inserted between the

[R] multiple graphs

2010-09-07 Thread moleps
Dear all, I´m trying to create multiple graphs on the same page, but they are all stacked on top of each other. My code: par(mfrow=c(2,2)) a-list(levels(bar$h.r)[c(1,3,6)]) print(a) lapply(a,function(x){ a-subset(bar,h.r==x) with(a,cdplot(wh~Age,ylab=x)) #plot.new()

Re: [R] multiple graphs

2010-09-08 Thread moleps
(bar,h.r==x) with(a, cdplot(wh~Age,ylab=x)) #plot.new() }) Regards, //M On 8. sep. 2010, at 03.37, David Winsemius wrote: On Sep 7, 2010, at 8:02 PM, moleps wrote: Dear all, I´m trying to create multiple graphs on the same page, but they are all stacked

[R] data-management: Rowwise NA

2010-06-03 Thread moleps
Dear R´ers.. In this mock dataset how can I generate a logical variable based on whether just tes or tes3 are NA in each row?? test-sample(c(A,NA,B),100,replace=T) test2-sample(c(A,NA,B),100,replace=T) test3-sample(c(A,NA,B),100,replace=T) tes-cbind(test,test2,test3) sam-c(test,test3)

Re: [R] data-management: Rowwise NA

2010-06-03 Thread moleps
Statistical Computing Facility Department of Statistics UC Berkeley spec...@stat.berkeley.edu On Thu, 3 Jun 2010, moleps wrote: Dear R?ers.. In this mock

[R] two columns into one

2010-06-03 Thread moleps
Dear R´ers, How can I create one single factor variable from two variables incorporating all possible combinations of the values?? test-sample(c(A,NA,B),100,replace=T) test2-sample(c(E,F,A),100,replace=T) tes-cbind(test,test2) pseduocode: r-function(test,test2) r AE AF AA NAE NAF NAA

[R] apply min function rowwise

2010-06-05 Thread moleps
I´m trying to tease out the minimum value from a row in a dataframe where all the variables are dates. apply(canc[,vec],1,function(x)min(x,na.rm=T)) However it only returns empty strings for the entire dataframe except for one date value (which is not the minimum date). I´ve also tried

Re: [R] apply min function rowwise

2010-06-05 Thread moleps
Appreciate it... //M On 5. juni 2010, at 20.11, Joshua Wiley wrote: On Sat, Jun 5, 2010 at 10:22 AM, moleps mole...@gmail.com wrote: thx. It was only the first instance that was class date. The rest were factors. So that explains it. If I want to change the rest in vec into class date

[R] paste together a string object later to be utilized in a function

2010-06-06 Thread moleps
Dear r-listers, I need to pass a string to a function. However the length of the string is dependent on the length of a vector. b-length(h) v-paste(rep(names(ts$a[,1:b,]),ts$a[,1:b,]),sep=) Is it possible somehow to pass this as an argument to a function later on ? Regards, //M

Re: [R] paste together a string object later to be utilized in a function

2010-06-07 Thread moleps
Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of moleps Sent: Sunday, June 06, 2010 1:51 PM To: r-help@r-project.org Subject: [R] paste together

[R] marginal structural models

2010-06-09 Thread moleps
Dear listers, Does anyone have any experience running marginal structural models in r or can point me in the direction of any good tutorials on this? Regards, //M __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] Latex and r

2010-06-16 Thread moleps
Dear R´ers I´m trying to get a summary table using latex and summary in the rms package to no avail. I´m running R 2.10.1, Mac OS X snow leopard and I have the mactex 2009 distribution installed. Any obvious things I´m missing? //M options(digits=3) set.seed(173) sex -

Re: [R] Latex and r

2010-06-16 Thread moleps
2010, Erik Iverson wrote: moleps wrote: Dear R´ers I´m trying to get a summary table using latex and summary in the rms package to no avail. I´m running R 2.10.1, Mac OS X snow leopard and I have the mactex 2009 distribution installed. Any obvious things I´m missing? file587f83cb.log

Re: [R] Latex and r (using summary from RMS)

2010-06-16 Thread moleps
On 16. juni 2010, at 20.10, Kevin E. Thorpe wrote: moleps wrote: Dear R´ers I´m trying to get a summary table using latex and summary in the rms package to no avail. I´m running R 2.10.1, Mac OS X snow leopard and I have the mactex 2009 distribution installed. Any obvious things I´m

[R] Remove squares from scatter3D

2010-06-22 Thread moleps
Dear All, I´ve been trying to find an option to scatter3D from rcmdr to remove the individual points from the plots but to no help so far. Removing the residuals is easy, but I cannot find a similar point option. Is there such an option that can be set to FALSE? Best, //M

[R] Data manipulation problem

2010-04-05 Thread moleps
Dear R´ers. I´ve got a dataset with age and year of diagnosis. In order to age-standardize the incidence I need to transform the data into a matrix with age-groups (divided in 5 or 10 years) along one axis and year divided into 5 years along the other axis. Each cell should contain the number

Re: [R] Data manipulation problem

2010-04-05 Thread moleps
.) Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of moleps Sent: Monday, April 05, 2010 11:46 AM To: r-help@r-project.org Subject: [R] Data manipulation problem Dear R´ers

Re: [R] Data manipulation problem

2010-04-05 Thread moleps
include.lowest and right arguments to cut age.factor - cut(age, breaks = seq(20, 90, by = 10), include.lowest = TRUE) year.factor - cut(year, breaks = seq(1950, 2000, by = 10), include.lowest = TRUE) table(age.factor, year.factor) moleps wrote: I

Re: [R] Data manipulation problem

2010-04-09 Thread moleps
wrote: On Apr 6, 2010, at 9:56 AM, moleps islon wrote: OK... next question.. Which is still a data manipulation problem so I believe the heading is still OK. ##So now I read my population data from excel. No, you read it from a text file and providing the first ten lines

[R] ctree and survival problem

2011-04-27 Thread moleps
Dear all, I was intrigued by the ctree command and wanted to check it out. I first ran the demo with example(ctree) and did get the survival graphs in the end. Upon doing this with my own data and yielding a Invalid operation on a survival time I tried to rerun example(ctree) and now I also

[R] ctree and survival problem

2011-04-27 Thread moleps
Forgot to mention that the ctree command is from the party library. //M __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented,

Re: [R] ctree and survival problem

2011-04-28 Thread moleps
simply upgrading R to the latest version and see if you get an error with the latest version of 'party'. My guess is that the error will go away. On Wed, Apr 27, 2011 at 3:40 PM, moleps mole...@gmail.com wrote: Forgot to mention that the ctree command is from the party library. //M

Re: [R] ctree and survival problem

2011-04-28 Thread moleps
Yup, thats the culprit. Thx. //M On 28. apr. 2011, at 18.36, Achim Zeileis wrote: On Thu, 28 Apr 2011, moleps wrote: sessionInfo yields the following: OK, the Design package causes the problem here. When you load the Design package, it provides a new Surv() and related methods

[R] Hmisc, summary.formula and catTest

2011-01-06 Thread moleps
Dear all, I´m specifying the fisher.exact test for use with summary.formula as follows: u-function(a,b){ j-fisher.test(a) p-list(P=j$p.value,stat=NA,df=NA,testname=j$method,statname=) return(p) } However I´m also required to specify stat df.

Re: [R] Hmisc, summary.formula and catTest

2011-01-06 Thread moleps
Allright..Works like a charm. However I do believe that the prtest vector should have been mentioned in the catTest or conTest option. Appreciate your time and effort. Best, //M On 6. jan. 2011, at 23.24, Erik Iverson wrote: Does the prtest argument help when you actually use the 'print'

Re: [R] Hmisc, summary.formula and catTest

2011-01-06 Thread moleps
Is it at all possible to specify this so that different tests display different parameters, ie have the continous test display F, df and p while tes categorical test display only P values? sf1 - summary(trt~sex+ascites+age,data=ex,test=T,method=reverse,catTest=u) print(sf1, prtest = P) //M

[R] mChoice prb in rms

2011-06-02 Thread moleps
Dear all, I´m trying to get a output table for age and the summary of a and b, stratified by epo as follows using summary.formula h-data.frame(a=sample(c(A,NA),100,replace=T),b=sample(c(B,NA),100,replace=T),age=rnorm(100,50,25),epo=sample(c(Y,N),100,T)) library(rms)

[R] Plot survival analysis with time dependent variables

2012-12-31 Thread moleps
Dear all, Is there an implementation of Simon Makuch method of plotting the survival function with time-dependent variables. I´m only able to find event.chart in Hmisc for the purpose and I would prefer the Simon and Makuch method. I believe stata has it implemented for this purpose, but I

[R] p value for joint probability

2011-01-31 Thread moleps
Dear all, Given rr-data.frame(r1-rnorm(1000,10,5),r2-rnorm(1000,220,5)) How can I add a column (rr$p) for the joint probability of each r1 r2 pair? I know how to add the column.. I just dont know how to compute the p value for joint probabilities given the two samples. //M

Re: [R] p value for joint probability

2011-02-01 Thread moleps
-data.frame(r1=-rnorm(1000,10,5),r2=-rnorm(1000,220,5)) with(rr,plot(r1,r2)) Best, //M On 31. jan. 2011, at 23.13, Peter Ehlers wrote: On 2011-01-31 12:42, moleps wrote: Dear all, Given rr-data.frame(r1-rnorm(1000,10,5),r2-rnorm(1000,220,5)) How can I add a column (rr$p) for the joint

Re: [R] p value for joint probability

2011-02-01 Thread moleps
:31 PM, moleps wrote: My terminology is probably way off. I´ll try again in plain english. I´d like to generate a scatter plot of r1 r2 and color code each pair according to the probability of observing the pair given that the two samples (r1 r2) are drawn from two independent normal

Re: [R] Using R to analyze multiple MRI studies

2014-07-06 Thread moleps
Yes-I did look through the CRAN view and could not find any package that featured a function whereby an MRI set was transformed into Talairach or MNI space. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

Re: [R] paste together a string object later to be utilized in a function

2010-06-07 Thread moleps islon
, moleps mole...@gmail.com wrote: Dear r-listers, I need to pass a string to a function. However the length of the string is dependent on the length of a vector. b-length(h) v-paste(rep(names(ts$a[,1:b,]),ts$a[,1:b,]),sep=) Is it possible somehow to pass this as an argument to a function

[R] Latex problem in Hmisc (3.8-1) and Mac Os X with R 2.11.1

2010-06-18 Thread moleps islon
Dear all, I did post this more or less identical mail in a follow up to another question I posted, but under another heading. I try again, but now under the correct header. upon running this code (from the Hmisc library-latex function) I believe the call to summary.formula is allright and

Re: [R] Data manipulation problem

2010-04-06 Thread moleps islon
I have to program this from scratch or is it possible to use an already existing function? //M qta- table(cut(age,breaks = seq(0, 100, by = 10),include.lowest = TRUE),cut(year,breaks=seq(1950,2010,by=5),include.lowest=TRUE On Mon, Apr 5, 2010 at 10:11 PM, moleps mole...@gmail.com wrote

Re: [R] Data manipulation problem

2010-04-07 Thread moleps islon
to add multiple columns based on another vector so I'd be very interested in another more general approach. //M On Tue, Apr 6, 2010 at 9:41 PM, David Winsemius dwinsem...@comcast.net wrote: On Apr 6, 2010, at 3:30 PM, David Winsemius wrote: On Apr 6, 2010, at 9:56 AM, moleps islon wrote

Re: [R] Plot survival analysis with time dependent variables

2012-12-31 Thread moleps islon
I did.But could only find the citation-not an implementation. On Tuesday, January 1, 2013, David Winsemius wrote: On Dec 31, 2012, at 4:38 PM, moleps wrote: Dear all, Is there an implementation of Simon Makuch method of plotting the survival function with time-dependent variables. I´m

[R] SetInternet2, RCurl and proxy

2011-01-31 Thread moleps islon
Dear all, Using the SetInternet2(TRUE) option works wonders with R in my sealed down work-environment. However, I'd like to use RCurl and apparently the proxy settings are not carried over. Is it possible to figure out the proxy-IP and port number from R after invoking SetInternet2? //M

Re: [R] SetInternet2, RCurl and proxy

2011-01-31 Thread moleps islon
: On Mon, 31 Jan 2011, moleps islon wrote: Dear all, Using the SetInternet2(TRUE) option works wonders with R in my sealed down work-environment. However, I'd like to use RCurl and apparently the proxy settings are not carried over. Is it possible to figure out the proxy-IP and port number from R

[R] MatchIt and sensitivity analysis

2011-02-10 Thread moleps islon
Dear all, Is there a package that allows me to run a sensitivy analysis on a matched dataset created using MatchIt? I am aware of both rbounds and the sensitivy function in the twang package but they do not allow matched objects from MatchIt as input. //M

[R] Using R to analyze multiple MRI studies

2014-07-03 Thread moleps islon
I need to analyze multiple T1 contrast enhanced MRI studies from different patients. They are all in DICOM format. I see that there are different packages for loading individual studies in DICOM format, however I have had limited luck so far researching how the different studies can be tranformed