Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
otoolej committed Oct 10, 2017
1 parent a423f04 commit cf50795
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
8 changes: 1 addition & 7 deletions gen_random_NIRS_data.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
% John M. O' Toole, University College Cork
% Started: 10-10-2017
%
% last update: Time-stamp: <2017-10-10 13:25:48 (otoolej)>
% last update: Time-stamp: <2017-10-10 16:42:04 (otoolej)>
%-------------------------------------------------------------------------------
function all_data=gen_random_NIRS_data(N_babies)
if(nargin<1 || isempty(N_babies)), N_babies=50; end
Expand Down Expand Up @@ -59,12 +59,6 @@
'outcome',num2cell(outcome));


% $$$ dispVars(100*length(find([all_data.outcome]==1))./N_babies, ...
% $$$ 100*length(find([all_data.outcome]==2))./N_babies, ...
% $$$ 100*length(find([all_data.outcome]==3))./N_babies, ...
% $$$ 100*length(find([all_data.outcome]==0))./N_babies)
% $$$

DBplot=0;
if(DBplot), set_figure(1); end
for n=1:N_babies
Expand Down
6 changes: 1 addition & 5 deletions holm_p_correction.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
% John M. O' Toole, University College Cork
% Started: 03-11-2014
%
% last update: Time-stamp: <2017-10-10 10:43:05 (otoolej)>
% last update: Time-stamp: <2017-10-10 16:42:14 (otoolej)>
%-------------------------------------------------------------------------------
function [p_adj,h]=holm_p_correction(p_values,alpha)
if(nargin<2 || isempty(alpha)), alpha=0.05; end
Expand Down Expand Up @@ -69,7 +69,3 @@
if(DBverbose)
print_table([p_values; p_values.*N; p_adj; h]',{'p-value','p-bonf','p-adj.','H'},[],[],1,3);
end


% $$$ dispVars(p_adj);
% $$$ dispVars(h);
16 changes: 0 additions & 16 deletions loglikelihood.ratio.test.MEM.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,4 @@ loglikelihood.ratio.test.MEM <- function(p1,p2,df1,df2){
show(res)

return(list('logLikeTable'=res,'whichModel'=betterFitModel))


# had this originally (from Vickis book), but not correct?;
## a <- logLik(p1,REML=TRUE)
## b <- logLik(p2,REML=TRUE)
## ll.diff <- -2*(a[1]-b[1])

## pvalue <- 0.5*(1-pchisq(ll.diff,df1)) + 0.5*(1-pchisq(ll.diff,df2))

## show(p1@call)
## show(p2@call)
## print(sprintf('logLik1=%f',a))
## print(sprintf('logLik2=%f',b))
## print(sprintf('log-like difference=%f; p-value=%f',ll.diff,pvalue))

## return(pvalue)
}

0 comments on commit cf50795

Please sign in to comment.