Displaying 4 results from an estimated 4 matches for "pdensity".
Did you mean:
density
2011 May 17
2
can not use plot.Predict {rms} reproduce figure 7.8 from Regression Modeling Strategies (http://biostat.mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf)
....mc.vanderbilt.edu/wiki/pub/Main/RmS/course2.pdf) by the
following code. Could any one help me figure out how to solve this?
setwd('C:/Rharrell')
require(rms)
load('data/counties.sav')
older <- counties$age6574 + counties$age75
label(older) <- '% age >= 65, 1990'
pdensity <- logb(counties$pop.density+1, 10)
label(pdensity) <- 'log 10 of 1992 pop per 1990 miles^2'
counties <- cbind(counties, older, pdensity) # add 2 vars. not in data
frame
dd <- datadist(counties)
options(datadist='dd')
f <- ols(democrat ~ rcs(pdensity,4) + rcs(pop.ch...
2007 Sep 27
1
R: anova.Design
...Modeling Strategies book, but failed on using anova.Design to
reproduce his table 7.1, Following is the code:
rm(list=ls())
library(Hmisc)
library(Design)
getHdata(counties)
counties$older <- counties$age6574 + counties$age75
label(counties$older) <- '% age >= 65, 1990'
counties$pdensity <- log10(counties$pop.density+1)
label(counties$pdensity) <- 'log 10 of 1992 pop per 1990 miles^2'
dd <- datadist(counties)
options(datadist='dd')
f <- ols(democrat ~ rcs(pdensity,4) + rcs(pop.change,3) + rcs(older,3) +
crime + rcs(college,5)
+ rcs(income,4) +...
2007 Oct 19
1
plot.Design
...res on page 140
of Prof. Frank Harrell's book 'Regression Modeling Strategies':
rm(list=ls())
options(width=128)
library(Hmisc)
library(Design)
getHdata(counties)
counties$older <- counties$age6574 + counties$age75
label(counties$older) <- '% age >= 65, 1990'
counties$pdensity <- log10(counties$pop.density+1)
label(counties$pdensity) <- 'log 10 of 1992 pop per 1990 miles^2'
dd <- datadist(counties)
options(datadist='dd')
f <- ols(democrat ~ rcs(pdensity,4) + rcs(pop.change,3) + rcs(older,3) +
crime + rcs(college,5)
+ rcs(income,4) +...
2010 Feb 10
1
looping problem
Hi R-users,
I have this code here:
library(numDeriv)
fprime <- function(z)
{ alp <- 2.0165;
rho <- 0.868;
# simplified expressions
a <- alp-0.5
c1 <- sqrt(pi)/(gamma(alp)*(1-rho)^alp)
c2 <- sqrt(rho)/(1-rho)
t1 <- exp(-z/(1-rho))
t2 <- (z/(2*c2))^a
bes1 <- besselI(z*c2,a)
t1bes1 <- t1*bes1
c1*t1bes1*t2
}
## Newton