Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Set up and run a two-sample independent t-test

# Import the libraries
import numpy as np
from scipy import stats
np.random.seed(42)

# Generate the random variables with the specified mean, std, and sample size
rvs1 = stats.norm.rvs(loc=5, scale=10,size=500)
rvs2 = stats.norm.rvs(loc=5, scale=20, size=500)

# Calculate the t statistic for these two sample populations
stats.ttest_ind(rvs1, rvs2)
Comment

PREVIOUS NEXT
Code Example
Python :: SerialClient.py", line 41, in <module import queue ImportError: No module named queue 
Python :: Liczby zespolone Python 
Python :: if(guess_password == list(password): 
Python :: colorized progress bar python in console 
Python :: prekladac 
Python :: python concat list to sql query string 
Python :: python program for simple interest 
Python :: python trim string to length 
Python :: python program to convert tuple into string 
Python :: insert column at specific position in pandas dataframe 
Python :: Python program to remove duplicate characters of a given string. 
Python :: program to segregate positive and negative numbers in same list 
Python :: multiple loss pytorch 
Python :: absolut beginners projects in python with tutorial 
Python :: truncate date to midnight in pandas column 
Python :: python spamming bot 
Python :: pil to grayscale 
Python :: string list into list pandas 
Python :: python print exception type and message 
Python :: run py file in another py file 
Python :: how to put more than one file type in pysimplegui 
Python :: numpy empty array 
Python :: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256 
Python :: python tkinter text widget 
Python :: pyspark correlation between multiple columns 
Python :: How to efficiently create a median finder for a stream of values, in Python? 
Python :: how many data types are specified to numeric values in python 
Python :: python import stringio 
Python :: procfile heroku django 
Python :: python close input timeout 
ADD CONTENT
Topic
Content
Source link
Name
4+7 =