Skip to content

Commit

Permalink
Merge pull request #15 from jeffersonfparil/dev
Browse files Browse the repository at this point in the history
Correcting StudentT distribution df as n-1 from p-1
  • Loading branch information
jeffersonfparil authored Jan 23, 2024
2 parents 1af8856 + ece069a commit ed4588b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/gwas/mle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Regression for UnivariateMaximumLikelihoodEstimation {
if n != n_ {
return Err(Error::new(ErrorKind::Other, "The number of samples in the dependent and independent variables are not the same size."));
}
let d = StudentsT::new(0.0, 1.0, p as f64 - 1.0).unwrap();
let d = StudentsT::new(0.0, 1.0, n as f64 - 1.0).unwrap();
self.t = Array1::from_elem(p, f64::NAN);
self.pval = Array1::from_elem(p, f64::NAN);
for i in 0..p {
Expand Down
2 changes: 1 addition & 1 deletion src/gwas/ols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl Regression for UnivariateOrdinaryLeastSquares {
if n != n_ {
return Err(Error::new(ErrorKind::Other, "The number of samples in the dependent and independent variables are not the same size."));
}
let d = StudentsT::new(0.0, 1.0, p as f64 - 1.0).unwrap();
let d = StudentsT::new(0.0, 1.0, n as f64 - 1.0).unwrap();
self.t = Array1::from_elem(p, f64::NAN);
self.pval = Array1::from_elem(p, f64::NAN);
for i in 0..p {
Expand Down

0 comments on commit ed4588b

Please sign in to comment.