Skip to content

Commit

Permalink
resid_std is stores as attribute of scores
Browse files Browse the repository at this point in the history
  • Loading branch information
livio committed Jan 20, 2024
1 parent 5eb44a4 commit 42145c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions R/compute_scores.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ compute_scores <- function(model0, model1,score_type = "standardized"){
attr(scores,"sd")=std_dev
attr(scores,"scale_objects")=scale_objects
attr(scores,"score_type")=score_type
attr(scores,"resid_std")=sqrtinvV_vect_times_residuals
rownames(scores)=names(model0$fitted.values)
return(scores)
}
4 changes: 3 additions & 1 deletion R/flipscores.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,11 @@ flipscores<-function(formula, family, data,
if(!is.null(flip_param_call$output_flips)&&flip_param_call$output_flips)
model$flips=flip_param_call$flips
flip_param_call$flips=NULL
names(nrm) <- names(std_dev) <- names(model$scores)<- names(model$Tspace) <- names(model$p.values) <-to_be_tested
attr(model$scores,"nrm")=nrm
attr(model$scores,"sd")=std_dev
attr(model$scores,"resid_std")=data.frame(lapply(results,function(x)attr(x[[1]]$scores,"resid_std")))
names(attributes(model$scores)$resid_std) <-names(nrm) <- names(std_dev) <- names(model$scores)<- names(model$Tspace) <- names(model$p.values) <-to_be_tested


### output
model$call=fs_call
Expand Down
1 change: 1 addition & 0 deletions R/utiliy_score_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ socket_compute_flip <- function(scores,flip_param_call){
attributes(score1)$scale_objects=attributes(scores)$scale_objects[[id_col]]
attributes(score1)$score_type=attributes(scores)$score_type
attributes(score1)$sd=attributes(scores)$sd
attributes(score1)$resid_std=attributes(scores)$resid_std
flip_param_call$scores=score1
res=eval(flip_param_call, parent.frame())
res$scores=score1
Expand Down

0 comments on commit 42145c1

Please sign in to comment.