Skip to content

Hossein-Zamaninasab/R-PValue-Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Excel P-Value Calculator in R

A simple yet practical R script that allows users to easily calculate the p-value between two data groups (columns) from an Excel file. This tool is ideal for students, researchers, and data analysts who need a quick and straightforward way to perform a basic statistical comparison.

✨ Features

  • Easy to Use: Reads data directly from .xlsx files without needing manual format conversion.
  • Automated Analysis: Automatically performs an independent two-sample t-test to calculate the p-value.
  • User-Friendly: Requires minimal code modification to work with your own data.
  • Clear Output: Provides a clean, human-readable output with a simple interpretation of the statistical significance.
  • Automatic Setup: Checks for and installs required R packages if they are not already present.

⚙️ Prerequisites

  • R: R software (version 4.0 or newer is recommended).
  • (Optional) RStudio: An integrated development environment for R that provides a better user experience.

🚀 Getting Started

Follow these steps to use the script with your own data:

1. Download the Project
Clone this repository or download all project files (analyze_data.R and sample_data.xlsx) into a single folder on your computer.

2. Prepare Your Data
Place your Excel data file (.xlsx) in the same folder. Make sure your data is organized into two columns with clear headers, just like the provided sample_data.xlsx file.

3. Configure the Script
Open the analyze_data.R script in R or RStudio. Navigate to the user-configurable section (marked as Step 2) and update the following three variables to match your file and column names:

# --- Step 2: Define File and Column Names ---
# User-configurable section. Change these values to match your file.

excel_file_path <- "your_data_file.xlsx" # <-- Change this to your file's name
column1_name <- "YourFirstColumnName"    # <-- Change this to your first column's header
column2_name <- "YourSecondColumnName"   # <-- Change this to your second column's header

4. Run the Script
Execute the analyze_data.R script.

5. View the Results
The output of the analysis will be printed directly to the console. It will look like this:

=============================================
      Statistical Analysis Results
=============================================

Comparing columns: Control_Group vs. Treatment_Group
From file: sample_data.xlsx

Calculated P-Value: 0.00008583313

--- Interpretation ---
The p-value is less than 0.05, which is typically considered statistically significant.
This suggests that there is a significant difference between the means of the two groups.

=============================================

📄 License

This project is licensed under the MIT License.

About

A simple R script to calculate p-values from Excel files.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages