Home arrow PHP arrow Page 3 - Performing Inferential Statistical Analysis with PHP

Programming Strategy in PHP - PHP

Statistics aren't just for Excel spreadsheets anymore. If you've been wondering how to use PHP to help you do a basic statistical analysis, keep reading. In this article you'll learn how to use PHP to help you compare data sets.

  1. Performing Inferential Statistical Analysis with PHP
  2. Overview of Statistical Comparison
  3. Programming Strategy in PHP
  4. The PHP Code
By: Codex-M
Rating: starstarstarstarstar / 2
October 07, 2009

print this article



It can be difficult to implement the above concepts in the programming. This is why you'll find very few PHP developers online who are willing to develop this kind of application.

Anyway, with the solid background provided above, we can start with a web form that accepts two data sets. It should be two text areas, to make it easy for users to enter data (using the copy-and-paste method instead of entering data one small piece at a time, which can be very stressful to use).

The script should then accept the numerical data and start computing the descriptive statistics (average, standard deviation, degrees of freedom). With these variables computed, we can compute the T value.

So how will the T-critical value be computed? The best method is to obtain t-critical value from MS Excel, save it as .csv, and then export it to the MySQL database. To follow the industry standard, we can fix those tables to use the 95% confidence level.

In Excel, the T-critical value can be computed using the Excel function called TINV (%error, degrees of freedom), so for a 95% level, % error is 5% (0.05). In an Excel spreadsheet, a table can be generated using this formula, like the one shown below:

Complete the tables as shown above (you can have more than 100 “degrees of freedom” to make sure your applications can accept high amount of samples).

If you have trouble converting your Excel worksheet to a MySQL database, you'll find a tutorial on ASP Free at the link to help you. 

Once the t-critical value is in place at the MySQL database, we can query it based on degrees of freedom and use PHP to compare it with the T value computed (above).

>>> More PHP Articles          >>> More By Codex-M

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: