[R] Error with Design.Function(fit)
Frank E Harrell Jr
f.harrell at vanderbilt.edu
Wed Apr 29 23:34:35 CEST 2009
x wrote:
> Hi all,
>
> I'm reposting this with a more appropriate subject.
>
> Do I need to define limits as the error message seems to suggest? If so, how? The error message, my code, the output and the first few lines of my data are all below.
>
> Thank you!
>
> "Error in Getlim(at, allow.null = TRUE, need.all = TRUE) :
> variable dmodel.df does not have limits defined in fit or with datadist"
>
> My code:
> ==================
> library(Hmisc); library(Design); library(lattice);
>
> dmodel.df = read.table("./data_cub3.txt", header=TRUE, nrows=100)
> f <- ols(dmodel.df$y1 ~ rcs(dmodel.df$x1,3) )
Why did you ignore the reply from another user earlier today?
library(Design) # implies library(Hmisc)
df <- read.table(...)
dd <- datadist(df); options(datadist='dd')
f <- ols(y1 ~ rcs(x1,3), data=df)
plot(f, x1=NA, ...)
Frank
> print(f)
>
> dd <- datadist(dmodel.df$x1)
> options(datadist="dd")
> describe(dmodel.df)
>
> print( Function(f) )
> plot(dmodel.df$x1, dmodel.df$y1)
> plot(f, add=TRUE, col="blue", pch=2)
>
> Output:
> ====================
> Linear Regression Model
>
> ols(formula = dmodel.df$y1 ~ rcs(dmodel.df$x1, 3))
>
> n Model L.R. d.f. R2 Sigma
> 100 501.6 2 0.9934 45128
>
> Residuals:
> Min 1Q Median 3Q Max
> -68644.8 -31355.6 -849.9 31823.3 154196.6
>
> Coefficients:
> Value Std. Error t Pr(>|t|)
> Intercept 35925 12789.6 2.809 0.0060121
> dmodel.df -1620 422.9 -3.832 0.0002260
> dmodel.df' 25202 523.9 48.102 0.0000000
>
> Residual standard error: 45130 on 97 degrees of freedom
> Adjusted R-Squared: 0.9932
>
> Error in Getlim(at, allow.null = TRUE, need.all = TRUE) :
> variable dmodel.df does not have limits defined in fit or with datadist
>
> Sample data:
> =========================
> config benchmark x1 noise y1
> 1 verify2 1 0.72 282
> 2 verify2 2 1.6 256
>
> ______________________________________________
> R-help at 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, minimal, self-contained, reproducible code.
>
--
Frank E Harrell Jr Professor and Chair School of Medicine
Department of Biostatistics Vanderbilt University
More information about the R-help
mailing list