Re: [R] Marginal Effects of continuous variable in lrm model (Design package)

From: Frank E Harrell Jr <f.harrell_at_vanderbilt.edu>
Date: Tue, 26 Jun 2007 13:29:22 -0500

Minyu Chen wrote:
> Dear all:
>
> When I am trying to get the marginal effects:
>
> summary(result7,adv_inc_ratio=mean(m9201
> $adv_inc_ratio),adv_price_ratio=mean(m9201$adv_price_ratio), ...(SOME
> MORE CONTINUOUS AND DISCRETE VARIABLES BUT I AM NOT LISTING)... regW=c
> (0,mean(m9201$regW),1), regWM=c(0,mean(m9201$regWM),1))
>
> It gave out an error message:
>
> Error in summary.Design(result7, adv_inc_ratio = mean(m9201
> $adv_inc_ratio), :
> ranges not defined here or with datadist for adv_inc_ratio
> adv_price_ratio agem1 change2 yr1Libor yr1Libor1mtLag yr1Libor1yrLag
> change21yrLag change21mtLag fwdReal4yr fwdInfl4yr
>
> But I remember from my previous operation a few months ago (I
> recorded the commands) that to summary the marginal effect, I don't
> have to specify the ranges for the discrete variables. However, I use
> the command again (with slight modification because of the newly
> added variables) it doesn't work. I don't know what went wrong.
>
> Thank you very much.
>
> Thanks,
> Minyu Chen

Please read the package's help files especially about the datadist function.

Frank

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University

______________________________________________
R-help_at_stat.math.ethz.ch 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, minimal, self-contained, reproducible code.
Received on Tue 26 Jun 2007 - 18:43:28 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 26 Jun 2007 - 19:32:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.