similar to: Would like to apply a weight variable to the summary function in Hmisc

Displaying 20 results from an estimated 10000 matches similar to: "Would like to apply a weight variable to the summary function in Hmisc"

2004 Dec 21
2
How to display each symbol in a different color using plot with summary.formula.reverse
Dear R Masters, I have searched high and low (the help archives and my various R reference material and help files) for a solution to what appears to me to be quite a simple problem. In the following syntax, variable n10 has three levels. I would like the symbols that appear in the graph for these three levels to be different colors. The best I have been able to do is to have the Key display
2004 Jun 06
4
Request help writing a function
I have been wrestling with this function for quite a while, and am not making headway. 1) I want to apply a function to the following columns of a dataframe: myfunction. <- apply(ph5028[,c(83:107)],2,function(x) ... 2) Within each of the above columns there is a single numeric code, 1, 2 or 3 or an NA. 3) My goal is to determine the percent of time each person used a 2 code. So if a person
2005 Aug 25
1
Attempting to recode elements contained in a list
Hello R-Masters, I have a list 's' with three elements, as shown below. I want to recode a.a, a.a2, and a.a3 to NA if the value in a.a is less than 3. I reivewed my Modern Applied Statistic Book, the online help and did some searching of R-help on the internet. I explored unlist and as.list.data.frame in an attempt to isolate the third element of the list s, but this was not helpful.
2002 Apr 29
1
Release of Design library; update of Hmisc library
The Design library has been fully ported to R except for Cox proportional hazards regression modeling (using Therneau's survival package) which will be available in about two weeks. It will take much longer to make all the example code executable, is it currently contains many examples for which data are not provided. Thanks to Xiao Gang Fan <xiao.gang.fan1 at libertysurf.fr> who
2002 Apr 29
1
Release of Design library; update of Hmisc library
The Design library has been fully ported to R except for Cox proportional hazards regression modeling (using Therneau's survival package) which will be available in about two weeks. It will take much longer to make all the example code executable, is it currently contains many examples for which data are not provided. Thanks to Xiao Gang Fan <xiao.gang.fan1 at libertysurf.fr> who
2003 Oct 07
3
Problem getting an ifelse statment to work
This is a "long" way; i.e., not necessarily efficient: > qs2 [1] 2 1 1 4 4 4 1 1 1 4 2 4 3 1 4 3 3 2 4 3 > qs9 [1] 4 4 1 3 4 3 1 3 1 4 1 2 3 3 4 4 1 4 2 3 > decision <- function(a, b) { + if (a == 1 || b == 1) return(1) + if (a == 2 || b == 2) return(2) + if (a == 3 || b == 3) return(3) + if (a == 4 || b == 4) return(4) + NA + } > mapply(decision,
2004 Apr 03
3
Seeking help for outomating regression (over columns) and storing selected output
Hello, I have spent considerable time trying to figure out that which I am about to describe. This included searching Help, consulting my various R books, and trail and (always) error. I have been assuming I would need to use a loop (looping over columns) but perhaps and apply function would do the trick. I have unsuccessfully tried both. A scaled down version of my situation is as follows:
2004 Mar 04
4
A file manipulation question
Hello R experts, The following problem outstrips my current programming knowledge. I have a dataframe with two fields that looks like the following: ID Contract 01 1 01 1 02 2 02 3 02 1 03 2 03 2 03 2 03 1 03 1 03 1 etc... I would like to end up with a dataframe with one row per ID where the value in the contract field would be the
2002 Jul 02
4
Hmisc?
I was looking for an R function to turn a matrix into a LaTeX table; did an R site search using Jon Barron's machine and turned up the latex() function in the Hmisc package. But the Hmisc package is an Splus package, and appears not to be available for R --- there is no hint of it in the list of contributed packages on CRAN. I had a look at the Hmisc package (via statlib) and there was no
2003 Jul 25
1
Difficulty replacing NAs using Hmisc aregImpute and Impute
Hello R experts I am using Hmisc aregImpute and Impute (following example on page 105 of The Hmisc and Design Libraries). *My end goal is to have NAs physically replaced in my dataframe. I have read the help pages and example in above sited pdf file, but to no avail. Here is example of what I did. Ph, my data frame, is attached. > xt <- aregImpute (~ q5 + q22rev02 + q28a, n.impute=10,
2003 Jun 16
1
Hmisc multiple imputation functions
Dear all; I am trying to use HMISC imputation function to perform multiple imputations on my data and I keep on getting errors for the code given in the help files. When using "aregImpute" the error is; >f <- aregImpute(~y + x1 + x2 + x3, n.impute=100) Loading required package: acepack Iteration:1 Error in .Fortran("wclosepw", as.double(w), as.double(x),
2003 May 16
1
Question on ldBands function in Hmisc package by Harrell
Has anyone tried to download Hmisc and used ldBands function for calculating Lan-Demets group sequential boundaries? The write-up in F.Harrell's website indicates that, besides downloading the package Hmisc, one needs to copy the progra ld98 from the University of Wisconsin website. As suggested, I did this but received another error message regarding the search path. I think I have fixed
2003 Apr 20
1
Hmisc interaction behavior
Dear R-helpers, Can someone explain to me why the function interaction() from the Hmisc library results in numeric? test1 <- c("A","B","C") test2 <- c("D","E","F") is.numeric(interaction(test1,test2)) [1] TRUE I had problems with this side effect in a different function. thanks, Remko Duursma
2003 May 19
2
upData levels in Hmisc
Dear listserve members, especially Prof. Harrell: I am trying to create a factor variable that has fewer levels than the original. I have a factor: >rosa$risk1 [1] 2 2 5 1 ... [1799] 3 3 1 3 1 6 3 3 1 5 3 5 3 3 3 0 3 3 3 1 1 3 Levels: 0 1 2 3 4 5 6 8 But when I do this: rosa2 <- upData(rosa,
2003 Sep 20
1
grep in version 1.8 (PR#4231)
Full_Name: Gregory L. Blevins Version: 1.8 OS: Windows 2000 Submission from: (NULL) (65.29.54.28) I see this when I open 1.8 Error in grep("united.states", Sys.getlocale("LC_CTYPE"), TRUE) : 5 arguments passed to "grep" which requires 6. R : Copyright 2003, The R Development Core Team Version 1.8.0 alpha (2003-09-18) R is free software and comes with
2004 Oct 06
8
Dataframe manipulation question
Hello, I have a data frame that has three fields. Resp# ActCode ProdUsed 100 3 2 100 3 2 100 4 3 100 4 3 101 3 6 102 2 1 102 3 1 103 5 1 103 5 1 103
2006 May 15
1
Trying to get values to display on horizontal barchart
Hello, R 2.3.0 Windows XP I have spent quite a bit of time trying to resolve my problem below, which included a R site search. The "vertical bars" syntax below produces a vertical bar chart with the values displayed above each bar. I want to cast this graphic horizontally, but I have not been able to arrive at a suitable outcome. The best I have been able to do, using the second block
2002 May 02
1
design/HMISC packages
Hello, No luck in loading Frank Harrell's packages -- did anyone encountered the same problem? R : Copyright 2002, The R Development Core Team Version 1.4.1 (2002-01-30) > library(design, T) Design library by Frank E Harrell Jr, Version of Wed Apr 17 17:07:30 EDT 2002 Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library
2003 Jun 12
3
Multiple imputation
Hi all, I'm currently working with a dataset that has quite a few missing values and after some investigation I figured that multiple imputation is probably the best solution to handle the missing data in my case. I found several references to functions in S-Plus that perform multiple imputation (NORM, CAT, MIX, PAN). Does R have corresponding functions? I searched the archives but was not
2003 Jul 27
1
multiple imputation with fit.mult.impute in Hmisc
I have always avoided missing data by keeping my distance from the real world. But I have a student who is doing a study of real patients. We're trying to test regression models using multiple imputation. We did the following (roughly): f <- aregImpute(~ [list of 32 variables, separated by + signs], n.impute=20, defaultLinear=T, data=t1) # I read that 20 is better than the default of