-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shapiro_test added
- Loading branch information
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#' Normality test with Shaprio_Wilk_test | ||
#' | ||
#' @param Data input data file | ||
#' | ||
#' @return dataframe with shapiro wilk test | ||
#' @export | ||
#' | ||
#' @examples Result<-Norm_test(Data) | ||
#' write.csv(Result,"Normality_test_Result.csv") | ||
#' | ||
Norm_test<-function(Data){ | ||
colnames(Data)<-Data[1,]; Data<-Data[-1,] | ||
Data[,4:ncol(Data)]<-sapply(Data[,4:ncol(Data)],function(x) as.numeric(x)) | ||
Data<-as.data.frame(sapply(Data[,4:ncol(Data)], function(x)shapiro.test(x)[["p.value"]])) | ||
colnames(Data)<-"Shapiro_Wilk_p_val" | ||
Data<-Data %>% mutate(Normality = case_when(Shapiro_Wilk_p_val<=0.05~"Non_parametric", | ||
Shapiro_Wilk_p_val>0.05~"Parametric")) | ||
Data} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.