[R] Calculate external validation

David Winsemius dwinsemius at comcast.net
Wed Dec 4 08:59:47 CET 2013


On Dec 3, 2013, at 12:45 PM, Juan Manuel Reyes S wrote:

> Dear R-project
> 
> I could not validate one logistic model because when I used the function
> lrm.fit of the package rms the program showed a error message. It said that
> the variable Clam and offset must have same length.

Giving arguments of the same length to a regression function would certainly seem to be appropriate.

> 
> ext <- lrm.fit( ,Clam, offset="X")

"X" would be a one-element character vector. Cannot tell what the object `Clam` might be. I certainly hope you have not been using the `attach` function. That way lies madness.

The three first arguments to `lrm.fit` are:

x:
design matrix with no column for an intercept

y:
response vector, numeric, categorical, or character

offset:	
optional numeric vector containing an offset on the logit scale


> 
> In this case, Clam is variable depend or variable that we want to
> predictive and X is linear predictor of the other logistic model.

Other model?

> 
> We want to evaluate a logistic model in new data set.

Evaluate? Please explain in more detail what procedure you propose. The `validate` function in pkg:rms would need a fit object that has been created with  x=TRUE and y=TRUE.

> However, we don't
> have the development data set of logistic model, only we have the equation.
> We are using the function lrm.fit because it allows to use offset.

`lrm` does allow an offset by way of its formula argument. See Arguments section of ?lrm

> 
> What do you recommend me?
> 

I recommend that you give a more complete example of your data, your "model", and your code that presents what you actually do have in hand. 

-- 
David.

> Thank you member of R-project
> 
> Juan Manuel Reyes
> 
> 	[[alternative HTML version deleted]]
> 
> 


David Winsemius
Alameda, CA, USA



More information about the R-help mailing list