<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Advanced Z-test hypothesis testing calculator with statistical analysis. Compute test statistics, critical values, p-values, and confidence intervals for research.">
    <meta name="keywords" content="z-test, hypothesis testing, statistics, statistical analysis, p-value">
    <title>Z-Test Hypothesis Testing Calculator</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" rel="stylesheet">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            background-color: #ffffff;
            color: #333333;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            line-height: 1.6;
        }
        
        .padtop {
            padding-top: 40px;
            padding-bottom: 40px;
        }
        
        .container {
            max-width: 1000px;
            margin: 0 auto;
        }
        
        header {
            background-color: #f8f9fa;
            border-bottom: 2px solid #e9ecef;
            margin-bottom: 30px;
        }
        
        header h1 {
            font-size: 2.5rem;
            font-weight: 700;
            color: #1a73e8;
            margin-bottom: 10px;
        }
        
        header p {
            font-size: 1.1rem;
            color: #666666;
            margin: 0;
        }
        
        .content-wrapper {
            display: flex;
            gap: 30px;
            flex-direction: column-reverse;
        }
        
        .results-section {
            background-color: #f8f9fa;
            padding: 25px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin-bottom: 30px;
        }
        
        .results-section h3 {
            color: #1a73e8;
            font-weight: 600;
            margin-bottom: 20px;
            font-size: 1.3rem;
        }
        
        .result-item {
            background-color: white;
            padding: 15px;
            margin-bottom: 12px;
            border-left: 4px solid #1a73e8;
            border-radius: 4px;
        }
        
        .result-label {
            font-weight: 600;
            color: #1a73e8;
            font-size: 0.95rem;
        }
        
        .result-value {
            font-size: 1.2rem;
            color: #333333;
            margin-top: 5px;
        }
        
        .conclusion-box {
            background-color: #e8f5e9;
            border: 2px solid #4caf50;
            padding: 20px;
            border-radius: 6px;
            margin-top: 15px;
        }
        
        .conclusion-box.reject {
            background-color: #ffebee;
            border-color: #f44336;
        }
        
        .conclusion-box h4 {
            color: #2e7d32;
            margin-bottom: 10px;
            font-weight: 600;
        }
        
        .conclusion-box.reject h4 {
            color: #c62828;
        }
        
        .form-section {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin-bottom: 30px;
        }
        
        .form-section h2 {
            color: #1a73e8;
            margin-bottom: 25px;
            font-weight: 600;
            font-size: 1.5rem;
        }
        
        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
            margin-bottom: 20px;
        }
        
        .form-group {
            display: flex;
            flex-direction: column;
        }
        
        .form-group label {
            font-weight: 600;
            color: #333333;
            margin-bottom: 8px;
            font-size: 0.95rem;
        }
        
        .form-group input,
        .form-group select {
            padding: 12px;
            border: 1px solid #d0d0d0;
            border-radius: 4px;
            font-size: 0.95rem;
            transition: border-color 0.3s;
        }
        
        .form-group input:focus,
        .form-group select:focus {
            border-color: #1a73e8;
            outline: none;
            box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
        }
        
        .form-helper {
            font-size: 0.85rem;
            color: #666666;
            margin-top: 5px;
        }
        
        .button-group {
            display: flex;
            gap: 12px;
            margin-top: 30px;
        }
        
        .btn-calculate {
            background-color: #1a73e8;
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 4px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s;
            font-size: 1rem;
        }
        
        .btn-calculate:hover {
            background-color: #1557b0;
        }
        
        .btn-reset {
            background-color: #f0f0f0;
            color: #333333;
            border: 1px solid #d0d0d0;
            padding: 12px 30px;
            border-radius: 4px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.3s;
            font-size: 1rem;
        }
        
        .btn-reset:hover {
            background-color: #e0e0e0;
        }
        
        .error-message {
            background-color: #ffebee;
            color: #c62828;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 20px;
            display: none;
        }
        
        .success-message {
            background-color: #e8f5e9;
            color: #2e7d32;
            padding: 15px;
            border-radius: 4px;
            margin-bottom: 20px;
            display: none;
        }
        
        .article-section {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin-bottom: 30px;
        }
        
        .article-section h2 {
            color: #1a73e8;
            margin-bottom: 20px;
            font-weight: 600;
            font-size: 1.5rem;
        }
        
        .article-section h3 {
            color: #1a73e8;
            margin-top: 25px;
            margin-bottom: 12px;
            font-weight: 600;
            font-size: 1.1rem;
        }
        
        .article-section p {
            margin-bottom: 15px;
            color: #333333;
            text-align: justify;
        }
        
        .faq-section {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin-bottom: 30px;
        }
        
        .faq-section h2 {
            color: #1a73e8;
            margin-bottom: 25px;
            font-weight: 600;
            font-size: 1.5rem;
        }
        
        .faq-item {
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid #e9ecef;
        }
        
        .faq-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }
        
        .faq-question {
            font-weight: 600;
            color: #1a73e8;
            margin-bottom: 10px;
            font-size: 0.95rem;
        }
        
        .faq-answer {
            color: #333333;
            line-height: 1.6;
        }

        .advanced-section {
            background-color: white;
            padding: 30px;
            border-radius: 8px;
            border: 1px solid #dee2e6;
            margin-bottom: 30px;
        }

        .advanced-section h2 {
            color: #1a73e8;
            margin-bottom: 25px;
            font-weight: 600;
            font-size: 1.5rem;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 25px;
        }

        .stat-card {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 6px;
            border-left: 4px solid #1a73e8;
        }

        .stat-card h4 {
            color: #1a73e8;
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 10px;
            text-transform: uppercase;
        }

        .stat-card p {
            color: #333333;
            margin: 0;
            line-height: 1.4;
        }

        .power-analysis-section {
            background-color: #f8f9fa;
            padding: 20px;
            border-radius: 6px;
            margin: 20px 0;
        }

        .power-analysis-section h3 {
            color: #1a73e8;
            margin-bottom: 15px;
            font-weight: 600;
        }

        .tabs-container {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            border-bottom: 2px solid #e9ecef;
        }

        .tab-btn {
            background: none;
            border: none;
            padding: 12px 20px;
            cursor: pointer;
            color: #666666;
            font-weight: 600;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
        }

        .tab-btn.active {
            color: #1a73e8;
            border-bottom-color: #1a73e8;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .interpretation-table {
            width: 100%;
            border-collapse: collapse;
            margin: 20px 0;
        }

        .interpretation-table th {
            background-color: #f0f0f0;
            padding: 12px;
            text-align: left;
            font-weight: 600;
            color: #333333;
            border-bottom: 2px solid #dee2e6;
        }

        .interpretation-table td {
            padding: 12px;
            border-bottom: 1px solid #dee2e6;
            color: #333333;
        }

        .interpretation-table tr:hover {
            background-color: #f9f9f9;
        }

        @media (max-width: 768px) {
            .form-row {
                grid-template-columns: 1fr;
                gap: 20px;
            }
            
            header h1 {
                font-size: 2rem;
            }
            
            .content-wrapper {
                flex-direction: column;
            }
            
            .button-group {
                flex-direction: column;
            }
        }
        
        .loading {
            display: none;
            text-align: center;
            color: #1a73e8;
            font-weight: 600;
            margin: 15px 0;
        }
    </style>

<link rel="canonical" href="https://toolstop.net/statistics/z-test-hypothesis-testing.html" /><meta name="robots" content="index, follow" /><meta name="monetag" content="8865c6ce350a21c4c922ae4adeec8d97">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">


		<link href="https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,500;1,600;1,700;1,800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&family=Figtree:ital,wght@0,300..900;1,300..900&family=Libre+Franklin:ital,wght@0,100..900;1,100..900&family=Neuton:ital,wght@0,200;0,300;0,400;0,700;0,800;1,400&family=Noto+Serif:ital,wght@0,100..900;1,100..900&family=Roboto&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'" rel="preload">
		
		
  <style>
    body { }
a{   text-decoration: none;  }
    /* ====== CSS-ONLY NAV COLLAPSE (checkbox hack) ====== */
    #nav-toggle { display: none; }
    .navbar-toggler {
      border: 0;
      outline: 0;
      padding: .25rem .5rem;
      line-height: 1;
      background: transparent;
      cursor: pointer;      position: relative;
    right: -60px;
    top: 4px;
    }
    .navbar-toggler .bar {
      display: block;
      width: 24px;
      height: 2px;
      margin: 5px 0;
      background: #fff;
    }
    
    .mfoot h4{
        font-size:16px;
    }
    
.mfoot a {
    padding: 3px 8px;
    margin: 7px 6px;
    display: inline-block;
    border: 1px solid #544707;
    border-radius: 12px;
    color: #6a570d;
}

    /* Default (lg and up) keep Bootstrap layout */
    @media (max-width: 991.98px) {
      /* hide menu by default on mobile */
      .navbar .navbar-collapse {
        display: none !important;
        width: 100%;
      }
      /* show when toggled */
      #nav-toggle:checked ~ .navbar-collapse {
        display: block !important;
      }
      /* make dropdown menus flow in the column (no absolute) */
      .navbar-nav .dropdown-menu {
        position: static;
        float: none;
        box-shadow: none;
        border: 0;
        padding-top: 0;
        padding-bottom: 0;
      }
      .navbar-nav .dropdown-item {
        padding-left: 1.25rem;
      }
    }

    /* ====== CSS-ONLY DROPDOWN ====== */
    .dropdown-menu { display: none; }
    /* open on hover (desktop) */
    .dropdown:hover > .dropdown-menu { display: block; }
    /* open on focus-within (tap/focus for mobile & keyboard) */
    .dropdown:focus-within > .dropdown-menu { display: block; }

    /* improve tap target for the toggle link */
    .dropdown-toggle {
      cursor: pointer;
    }
    /* remove default caret behavior from Bootstrap JS (not used) */
    .dropdown-toggle::after {
      margin-left: .25rem;
      vertical-align: .255em;
      content: "▾";
      border: 0;      position: relative;
    top: 4px;
    }
    
    ul{
        padding-left: 0px;
    font-size: 15px;
    }
    
    ul li{
            list-style: none;
    padding: 4px 2px;
    }
    
    header h1{
        font-size:26px; color:#333;    margin-top:15px;
    }

    header{
       margin-bottom: 10px;  text-align: center;      border-bottom: 2px solid #a6b3b5;
    }
    
    
    i{
            font-size: 26px;      position: relative;
    top: 3px;
    }
    
    
    div.myfin h3{
        font-size:18px;
    }
    
       .card { border-radius: .8rem; }
    .form-section-title { font-weight:600; font-size:1.05rem; }
    .small-note { font-size:.875rem; color:#6c757d; }
    .result-number { font-size:1.15rem; font-weight:700; }
    
    .form-control{
            border: 1px solid #9d9d9d;
    }
    
    ul li{
            line-height: 28px;
    }
        
    ol li{
            line-height: 28px;
    }
    section h3{
        font-size: 1.4rem;
    }
    
        div h3{
        font-size: 1.4rem;
    }
    
    section h2{
        font-size: 1.4rem;
    }
    
    div h2{
        font-size: 1.3rem;
   
    }
    
    
    details{
            line-height: 33px;
    }
    
    
    footer{
        margin:0px; background: #19566e; color:#fff;
    }
    
    .navbar .container{
        display: inline-block;
    }
    
    .navbar-brand {
    display: inline-block;
    padding-top: .6125rem;
    }
    
           .padtop {
          
            padding-bottom: 1rem;
        
             
           }
           
           
           select{
               border:1px solid #ccc;
           }
           
           .form-select{
                 border:1px solid #999999;
           }
           
.mybut {
    background: #685827;
    border: 0px;
    padding: 5px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}
.mybut:hover{
    background:#594b1e;  color:#fff;
}


.btn-outline-danger {
    background: #743172;
    border: 0px;
    padding: 5px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}



.btn-dark{
        background: #685827;
    border: 0px;
    padding: 5px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}


.btn-primary {
    background: #0f677a;
    border: 0px;
    padding: 5px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}
.btn-primary:hover{
    background:#594b1e;  color:#fff;
}

.help {
    font-size: .81rem;
}

footer a{
    color:#fff;
}
#btnReset{
    background: #3c7c35;
    border: 0px;
    padding: 5px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}


.btn-outline-secondary{
    background: #3c7c35;
    border: 0px;
    padding: 7px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}
		
.btn-secondary{
    background: #3c7c35;
    border: 0px;
    padding: 7px 16px;
    font-family: 'Roboto Condensed';
    margin-top: 16px;
    font-size: 16px;
    color: #fff;
    border-radius: 6px;
}
	

				.padtop{
				    width: 100%;

padding-top:26px;
				text-align:center;
			}
			
			.padtop h1{
			    color: #434d52;
    font-family: 'Barlow Condensed';
    font-weight: 400; font-size:32px;
}
			
			.padtop p{
				    color: #363535;
    font-family: 'Roboto Condensed';
    font-weight: 400;
    font-size: 17px;
    line-height: 27px;
    padding: 20px 88px;
				padding-bottom:0px;
    letter-spacing: .41px;
    border-top: 1px solid #b2ac9038;
			}
			
    table tr th{
    font-family: 'Roboto Condensed';
  font-weight: 500;
  font-size: 16px;
  color: #444;
}


table th, table td, .wp-block-table th, .wp-block-table td {
  text-align: left;
  border: 1px solid #D4D4D8;

}

.reslt{
  border-bottom: 1px solid #ccc;
  padding-bottom: 32px;
}
 h2{
    		font-family: 'Figtree';
  font-size: 20px;
  background: #eceeef;
  padding: 9px;  margin-top: 22px;
  border-left: 5px solid #4d7278;
  margin-bottom:18px;
  color:#333;
}

h3{
    font-family: 'Roboto Condensed';
  font-size: 19px;
}.h4, h4 {
    font-size: calc(0.975rem + .3vw);
}
.form-label {
    font-family: 'Figtree';
}

.form-control
 {
    border: 1px solid #999999;
}


.section-title {
    letter-spacing: .2px;
    font-family: 'Rubik';
    font-weight: 500;
    color: #333;
    padding-bottom: 14px;
}

.navbar-dark .navbar-brand {
    color: #fff;
    font-family: 'Rubik';
    font-size: 22px;
}

.navbar {
    padding: .2rem 1rem;  background: #242e32
}

@media screen and (max-width: 770px) {

.padtop p {

    padding: 12px 15px;
}

.padtop {
    padding: 6px 3px;
  
}

.mybut {
    padding: 10px 16px;

}

.btn-dark{
    padding: 10px 16px;

}
.btn-primary{
    padding: 10px 16px;

}

.btn-secondary{
    padding: 10px 16px;

}
}

.navbar{
    background: #19566e;
  border-bottom: 3px solid #134c62;
}

.btt {
    border-bottom: 1px dashed #ccc;
    padding: 10px 14px;
}

.btt a{
        color: #006699;
    font-size: 15px;
}

  </style>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-N5PYSG47ZE"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-N5PYSG47ZE');
</script>

</head>
<body>

  <!-- NAVBAR (no JS needed) -->
  <nav class="navbar navbar-expand-lg navbar-dark  ">
    <div class="container">
        
        
        <div class="row" >
            
            
            <div class="col-3">
        
      <a class="navbar-brand" href="https://toolstop.net/">ToolsTop</a>

</div>  <div class="col-9">
  
  
        <!-- Checkbox controls the collapse -->
      <input type="checkbox" id="nav-toggle" aria-label="Toggle navigation" />
      <label for="nav-toggle" class="navbar-toggler mb-0">
        <span class="bar"></span>
        <span class="bar"></span>
        <span class="bar"></span>
      </label>

  
      <!-- Collapsible content -->
      <div class="navbar-collapse">
        <ul class="navbar-nav ml-auto">
          <li class="nav-item active"><a class="nav-link" href="https://toolstop.net/">Home <span class="sr-only"></span></a></li>

          <!-- CSS-only dropdown -->
          <li class="nav-item active">
            <!-- tabindex makes it focusable; href="#" prevents navigation -->
            <a class="nav-link " href="/maths/" tabindex="0" >Maths</a>

            

          </li>
        <li class="nav-item active"><a class="nav-link" href="/statistics/">Statistics</a></li>
        
        <li class="nav-item active"><a class="nav-link" href="/physics/">Physics</a></li>
        
        <li class="nav-item active"><a class="nav-link" href="/chemistry/">Chemistry</a></li>
        
        <li class="nav-item active"><a class="nav-link" href="/electrical/">Electrical</a></li>
        
        <li class="nav-item active"><a class="nav-link" href="/construction/">Construction</a></li>
        
          <li class="nav-item active"><a class="nav-link" href="#">Blog</a></li>
        </ul>
      </div>
      
      
   
   </div>
   
   </div>
   
   
    </div>
  </nav>
  
    
<div style="width:100%; margin-top:12px;" align="center">
<script>
  atOptions = {
    'key' : '34292baef80c5250e40a24b143748094',
    'format' : 'iframe',
    'height' : 60,
    'width' : 468,
    'params' : {}
  };
</script>
<script src="https://bauval.org/22/34292baef80c5250e40a24b143748094"></script>
</div>
  
    <header>
        <div class="container padtop">
            <h1>Z-Test Hypothesis Testing</h1>
            <p>Perform advanced statistical analysis with critical values and p-value calculations.</p>
        </div>
    </header>
    
    <div class="container">
        <div class="content-wrapper">
            <!-- Results Section -->
            <div class="results-section" id="resultsSection" style="display: none;">
                <h3>Statistical Analysis Results</h3>

                <div class="tabs-container">
                    <button class="tab-btn active" onclick="switchTab(event, 'summary')">Summary</button>
                    <button class="tab-btn" onclick="switchTab(event, 'advanced')">Advanced Metrics</button>
                    <button class="tab-btn" onclick="switchTab(event, 'assumptions')">Assumptions</button>
                </div>

                <div id="summary" class="tab-content active">
                    <div id="resultsContainer"></div>
                    <div id="conclusionBox"></div>
                </div>

                <div id="advanced" class="tab-content">
                    <div id="advancedContainer"></div>
                </div>

                <div id="assumptions" class="tab-content">
                    <div id="assumptionsContainer"></div>
                </div>
            </div>
            
            <!-- Form Section -->
            <div class="form-section">
                <h2>Test Parameters</h2>
                
                <div class="error-message" id="errorMessage"></div>
                <div class="success-message" id="successMessage"></div>
                <div class="loading" id="loading">Calculating results...</div>
                
                <form id="zTestForm">
                    <div class="form-row">
                        <div class="form-group">
                            <label for="sampleMean">Sample Mean (x̄)</label>
                            <input type="number" id="sampleMean" name="sampleMean" step="0.01" required>
                            <span class="form-helper">Average value of your sample</span>
                        </div>
                        <div class="form-group">
                            <label for="populationMean">Population Mean (μ)</label>
                            <input type="number" id="populationMean" name="populationMean" step="0.01" required>
                            <span class="form-helper">Hypothesized population mean</span>
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label for="stdDeviation">Standard Deviation (σ)</label>
                            <input type="number" id="stdDeviation" name="stdDeviation" step="0.01" min="0.01" required>
                            <span class="form-helper">Population standard deviation</span>
                        </div>
                        <div class="form-group">
                            <label for="sampleSize">Sample Size (n)</label>
                            <input type="number" id="sampleSize" name="sampleSize" step="1" min="2" required>
                            <span class="form-helper">Number of observations</span>
                        </div>
                    </div>
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label for="significanceLevel">Significance Level (α)</label>
                            <select id="significanceLevel" name="significanceLevel" required>
                                <option value="">Select significance level</option>
                                <option value="0.01">0.01 (1%)</option>
                                <option value="0.05">0.05 (5%)</option>
                                <option value="0.10">0.10 (10%)</option>
                            </select>
                            <span class="form-helper">Probability of Type I error</span>
                        </div>
                        <div class="form-group">
                            <label for="testType">Test Type</label>
                            <select id="testType" name="testType" required>
                                <option value="">Select test type</option>
                                <option value="two-tailed">Two-Tailed Test</option>
                                <option value="left-tailed">Left-Tailed Test</option>
                                <option value="right-tailed">Right-Tailed Test</option>
                            </select>
                            <span class="form-helper">Direction of alternative hypothesis</span>
                        </div>
                    </div>
                    
                    <div class="button-group">
                        <button type="button" class="btn-calculate" id="calculateBtn">Calculate Z-Test</button>
                        <button type="reset" class="btn-reset" id="resetBtn">Reset Form</button>
                    </div>
                </form>
            </div>
            
            <!-- Article Section -->
            <div class="article-section">
                <h2>Understanding Z-Test Hypothesis Testing</h2>
                
                <h3>Definition and Core Concept</h3>
                <p>The Z-test is a statistical method for hypothesis testing. It compares a sample mean to a population mean. The test assumes a known population standard deviation. This test follows a normal distribution pattern.</p>
                
                <h3>When to Use Z-Test</h3>
                <p>Use Z-test when sample size exceeds thirty observations. The population standard deviation must be known beforehand. The data should follow a normal distribution. It works best for large sample sizes.</p>
                
                <h3>The Z-Statistic Explained</h3>
                <p>The Z-statistic measures how many standard errors away the sample mean is. It follows the formula: Z = (x̄ - μ) / (σ/√n). Higher absolute Z values indicate stronger evidence. This value determines hypothesis test conclusions.</p>
                
                <h3>Critical Values and Regions</h3>
                <p>Critical values define rejection boundaries for the null hypothesis. Two-tailed tests have two critical values symmetrically placed. One-tailed tests have a single critical value. Comparison with Z-statistic determines test outcome.</p>
                
                <h3>P-Value Interpretation</h3>
                <p>The p-value represents probability of observing such extreme results. Lower p-values provide stronger evidence against null hypothesis. Compare p-value directly with significance level (α). Values below α suggest rejecting the null hypothesis.</p>
                
                <h3>Confidence Intervals in Testing</h3>
                <p>Confidence intervals estimate the true population parameter range. A 95% confidence interval uses 1.96 as the Z multiplier. The margin of error combines standard error with critical value. Narrower intervals indicate more precise estimates.</p>
                
                <h3>Type I and Type II Errors</h3>
                <p>Type I error occurs when rejecting a true null hypothesis. Type II error happens when failing to reject false hypothesis. Significance level (α) controls probability of Type I error. Sample size and effect size influence Type II error probability.</p>
                
                <h3>Assumptions for Valid Z-Test</h3>
                <p>The sample must be randomly selected from the population. Population standard deviation should be known or available. Sample size should be sufficiently large (n ≥ 30). Data should approximately follow a normal distribution.</p>
                
                <h3>Practical Applications</h3>
                <p>Quality control uses Z-tests for process monitoring purposes. Medical research applies Z-tests for treatment effectiveness testing. Marketing professionals use these tests for campaign analysis. Educational assessment employs Z-tests for performance evaluation.</p>
            </div>
            
            <!-- FAQ Section -->
            <div class="faq-section">
                <h2>Frequently Asked Questions</h2>

                <div class="faq-item">
                    <div class="faq-question">What is the main difference between Z-test and t-test?</div>
                    <div class="faq-answer">Z-test requires knowing the population standard deviation. T-test uses sample standard deviation as an estimator. Z-test is preferred for large samples. T-test is more reliable for smaller samples.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">Why is significance level important in hypothesis testing?</div>
                    <div class="faq-answer">Significance level defines the rejection threshold for null hypothesis. It represents the maximum acceptable probability of Type I error. Common values are 0.01, 0.05, and 0.10. Lower values mean stricter testing criteria.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">What does p-value tell us about our results?</div>
                    <div class="faq-answer">P-value indicates probability of results under null hypothesis assumption. Lower p-values suggest stronger evidence against null hypothesis. It is not the probability that null hypothesis is true. Values below α lead to rejecting null hypothesis.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">How do we interpret a two-tailed versus one-tailed test?</div>
                    <div class="faq-answer">Two-tailed tests check for differences in both directions. One-tailed tests check for differences in one specific direction. Two-tailed tests divide significance level between two tails. One-tailed tests use all significance in single direction.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">What is the standard error and its significance?</div>
                    <div class="faq-answer">Standard error measures the variability of sample means. It equals population standard deviation divided by square root of sample size. Larger samples produce smaller standard errors. Standard error is crucial for Z-statistic calculation.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">Can we use Z-test for any sample size?</div>
                    <div class="faq-answer">Z-test works best with sample sizes of thirty or larger. Smaller samples may violate normality assumptions necessary for Z-test. Central Limit Theorem ensures normality for large samples. Very small samples require alternative testing methods.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">What does it mean to reject the null hypothesis?</div>
                    <div class="faq-answer">Rejecting null hypothesis indicates sufficient evidence for alternative hypothesis. It means observed data is unlikely under null hypothesis assumption. This doesn't prove the alternative hypothesis is absolutely true. Rejection depends on chosen significance level.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">How is the confidence interval related to hypothesis testing?</div>
                    <div class="faq-answer">Confidence intervals provide a range of plausible parameter values. A 95% confidence interval relates to 0.05 significance level. If interval excludes null value, test rejects null hypothesis. Intervals offer more information than simple hypothesis test results.</div>
                </div>

                <div class="faq-item">
                    <div class="faq-question">What is effect size and why does it matter?</div>
                    <div class="faq-answer">Effect size measures the magnitude of difference between means. It indicates practical significance beyond statistical significance. Common measure is Cohen's d, calculated as mean difference divided by standard deviation. Large effect sizes suggest meaningful real-world differences.</div>
                </div>
            </div>

            <!-- Advanced Statistics Section -->
            <div class="advanced-section">
                <h2>Advanced Z-Test Concepts</h2>

                <div class="stats-grid">
                    <div class="stat-card">
                        <h4>Statistical Power</h4>
                        <p>The probability of correctly rejecting a false null hypothesis. Higher power (0.80+) is desirable for research.</p>
                    </div>
                    <div class="stat-card">
                        <h4>Type I Error (α)</h4>
                        <p>The probability of rejecting a true null hypothesis. Also called false positive rate. Controlled by significance level.</p>
                    </div>
                    <div class="stat-card">
                        <h4>Type II Error (β)</h4>
                        <p>The probability of failing to reject a false null hypothesis. Also called false negative rate. Related to statistical power.</p>
                    </div>
                    <div class="stat-card">
                        <h4>Effect Size Categories</h4>
                        <p>Negligible: |d| < 0.2 | Small: 0.2-0.5 | Medium: 0.5-0.8 | Large: > 0.8</p>
                    </div>
                </div>

                <div class="power-analysis-section">
                    <h3>Power Analysis Guidance</h3>
                    <table class="interpretation-table">
                        <thead>
                            <tr>
                                <th>Effect Size</th>
                                <th>Sample Size (n=30)</th>
                                <th>Interpretation</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>Small (0.2)</td>
                                <td>64-85</td>
                                <td>Subtle differences require larger samples</td>
                            </tr>
                            <tr>
                                <td>Medium (0.5)</td>
                                <td>30-50</td>
                                <td>Moderate differences adequate power</td>
                            </tr>
                            <tr>
                                <td>Large (0.8)</td>
                                <td>15-20</td>
                                <td>Obvious differences need fewer samples</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

                <h3>Decision Tree for Z-Test Selection</h3>
                <p>Is sample size ≥ 30? Yes → Is population SD known? Yes → Use Z-test. No → Use t-test. No → Use t-test (or collect more data).</p>

                <h3>Reporting Z-Test Results</h3>
                <p>Include: sample mean, population mean, standard deviation, sample size, Z-statistic, p-value, and effect size. Report 95% confidence interval. State conclusion clearly: reject or fail to reject.</p>
            </div>
        </div>
    </div>
    
    <script>
        const form = document.getElementById('zTestForm');
        const calculateBtn = document.getElementById('calculateBtn');
        const resetBtn = document.getElementById('resetBtn');
        const errorMsg = document.getElementById('errorMessage');
        const successMsg = document.getElementById('successMessage');
        const resultsSection = document.getElementById('resultsSection');
        const resultsContainer = document.getElementById('resultsContainer');
        const conclusionBox = document.getElementById('conclusionBox');
        const loading = document.getElementById('loading');

        calculateBtn.addEventListener('click', calculateZTest);
        resetBtn.addEventListener('click', resetForm);

        function switchTab(event, tabName) {
            event.preventDefault();

            // Hide all tab contents
            const contents = document.querySelectorAll('.tab-content');
            contents.forEach(content => content.classList.remove('active'));

            // Remove active class from all buttons
            const buttons = document.querySelectorAll('.tab-btn');
            buttons.forEach(btn => btn.classList.remove('active'));

            // Show selected tab and highlight button
            document.getElementById(tabName).classList.add('active');
            event.target.classList.add('active');
        }

        async function calculateZTest() {
            errorMsg.style.display = 'none';
            successMsg.style.display = 'none';
            loading.style.display = 'block';

            const formData = {
                action: 'calculate',
                sampleMean: document.getElementById('sampleMean').value,
                populationMean: document.getElementById('populationMean').value,
                stdDeviation: document.getElementById('stdDeviation').value,
                sampleSize: document.getElementById('sampleSize').value,
                significanceLevel: document.getElementById('significanceLevel').value,
                testType: document.getElementById('testType').value
            };

            try {
                const response = await fetch(window.location.href, {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(formData)
                });

                const data = await response.json();
                loading.style.display = 'none';

                if (data.error) {
                    errorMsg.textContent = data.error;
                    errorMsg.style.display = 'block';
                    resultsSection.style.display = 'none';
                } else {
                    displayResults(data);
                    successMsg.textContent = 'Calculation completed successfully!';
                    successMsg.style.display = 'block';
                }
            } catch (error) {
                loading.style.display = 'none';
                errorMsg.textContent = 'An error occurred: ' + error.message;
                errorMsg.style.display = 'block';
                resultsSection.style.display = 'none';
            }
        }

        function displayResults(data) {
            // Summary Tab
            resultsContainer.innerHTML = `
                <div class="result-item">
                    <div class="result-label">Z-Statistic</div>
                    <div class="result-value">${data.zStatistic}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Standard Error</div>
                    <div class="result-value">${data.standardError}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Critical Value</div>
                    <div class="result-value">${data.criticalValue}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">P-Value</div>
                    <div class="result-value">${data.pValue}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Effect Size (Cohen's d)</div>
                    <div class="result-value">${data.effectSize}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">95% Confidence Interval</div>
                    <div class="result-value">[${data.confidenceInterval.lower}, ${data.confidenceInterval.upper}]</div>
                    <div class="form-helper">Margin of Error: ±${data.confidenceInterval.margin}</div>
                </div>
            `;

            conclusionBox.innerHTML = `
                <div class="conclusion-box ${data.reject ? 'reject' : ''}">
                    <h4>${data.conclusion}</h4>
                    <p>${data.interpretation}</p>
                </div>
            `;

            // Advanced Metrics Tab
            const advancedContainer = document.getElementById('advancedContainer');
            advancedContainer.innerHTML = `
                <div class="result-item">
                    <div class="result-label">Effect Size Category</div>
                    <div class="result-value">${data.effectSizeCategory}</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Statistical Power (1 - β)</div>
                    <div class="result-value">${(data.power * 100).toFixed(2)}%</div>
                    <div class="form-helper">Probability of detecting true effect</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Type II Error Rate (β)</div>
                    <div class="result-value">${data.type2Error}%</div>
                    <div class="form-helper">Probability of false negative</div>
                </div>
                <div class="result-item">
                    <div class="result-label">Standardized Mean Difference</div>
                    <div class="result-value">${data.standardizedMeanDiff}</div>
                </div>
                <div class="power-analysis-section">
                    <h3>Sample Size Assessment</h3>
                    <div class="result-item">
                        <div class="result-label">${data.sampleSizeAdequacy.status}</div>
                        <div class="result-value">${data.sampleSizeAdequacy.message}</div>
                    </div>
                </div>
            `;

            // Assumptions Tab
            const assumptionsContainer = document.getElementById('assumptionsContainer');
            let assumptionsHTML = '<h3>Test Assumptions Status</h3>';
            for (let key in data.testAssumptions) {
                const title = key.replace(/_/g, ' ').toUpperCase();
                assumptionsHTML += `
                    <div class="result-item">
                        <div class="result-label">${title}</div>
                        <div class="result-value">${data.testAssumptions[key]}</div>
                    </div>
                `;
            }
            assumptionsContainer.innerHTML = assumptionsHTML;

            resultsSection.style.display = 'block';
        }

        function resetForm() {
            form.reset();
            resultsSection.style.display = 'none';
            errorMsg.style.display = 'none';
            successMsg.style.display = 'none';
        }
    </script>
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>


<div class="container mfoot" style="font-size:14px; margin-top:30px;"><h4>Related Calculators</h4><a href="https://toolstop.net/statistics/average-calculator.html" >Average Calculator Statistics</a><a href="https://toolstop.net/statistics/geometric-mean-calculator.html" >Geometric Mean Calculator</a><a href="https://toolstop.net/statistics/inter-quartile-range-calculator.html" >Inter Quartile Range Calculator</a><a href="https://toolstop.net/statistics/lower-quartile-calculator.html" >Lower Quartile Calculator</a><a href="https://toolstop.net/statistics/maximum-calculator.html" >Maximum Calculator</a><a href="https://toolstop.net/statistics/mean-calculator-statistics.html" >Mean Calculator Statistics</a><a href="https://toolstop.net/statistics/median-calculator-statistics.html" >Median Calculator Statistics</a><a href="https://toolstop.net/statistics/midhinge-calculator-statistics.html" >Midhinge Calculator Statistics</a><a href="https://toolstop.net/statistics/mid-range-calculator.html" >Mid Range Calculator Statistics</a><a href="https://toolstop.net/statistics/minimum-calculator-statistics.html" >Minimum Calculator Statistics</a>
<br>
<br>

<p>Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well. 

</p>


</div>
<br>

  <footer class="py-4  text-white-50">
    <div class="container text-center">
      <small>&copy; 2026 toolstop.net</small>
      
       &nbsp; |  &nbsp;
      <a href="/privacy_policy.html" target=_blank><small>Privacy Policy</small></a>
      
      &nbsp; |  &nbsp;
      <a href="/terms_of_service.html" target=_blank><small>Terms of Service</small></a>
      
       &nbsp; |  &nbsp;
     <a href="/sitemap.xml" target=_blank><small> Sitemap</small></a>
      
      
    </div>
  </footer>
  

  
  </body>
  </html>