PHP Classes

PHP Statistics Functions: Parse numbers from text data and return statistics

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 258 All time: 7,831 This week: 560Up
Version License PHP version Categories
raw2table 1.0.0Freeware5Algorithms, PHP 5, Statistics, Parsers
Description 

Author

This class can parse numbers from text data and return statistics.

It takes a string with a series of numbers and several computes statistics from those numbers.

The class can return statistics values like the smallest and largest value, the width of the number of range, the total number of classes, the distance frequency table, etc..

Innovation Award
PHP Programming Innovation award nominee
April 2018
Number 6
Some applications need to take numeric values eventually entered in spreadsheets and process them somehow in a useful way.

This package can take numbers in a text string and process them by calculating several types of supported statatistic functions.

Manuel Lemos
Picture of Aditya Rahman
  Performance   Level  
Name: Aditya Rahman <contact>
Classes: 1 package by
Country: Indonesia Indonesia
Age: 25
All time rank: 395966 in Indonesia Indonesia
Week rank: 164 Up5 in Indonesia Indonesia Up
Innovation award
Innovation award
Nominee: 1x

Example

<html>
    <head>
        <title>Raw2Table</title>
        <style>
            td,th {
                padding: 5px;
            }
        </style>
    </head>
    <body>
        <form method="post">
            <textarea name="raw" rows="20" cols="100"></textarea><br/>
            <input type="submit">
        </form>

        <?php
           
include "raw2table.php";
            if(isset(
$_POST['raw'])):
       
?>
<table cellspacing="0" border="1">
            <tr>
                <th>Range</th>
                <th>Frekuensi</th>
                <th>Frekuensi Kumulatif</th>
            </tr>
            <?php
                $obj
= new raw2table();
               
$data = $obj->convert_data($_POST['raw']);
               
$row = 0;
                foreach (
$obj->get_freq_dist_table($data) as $item) :
           
?>
<tr>
                    <td align="center"><?=$item['min']?> - <?=$item['max']?></td>
                    <td align="center"><?=$item['freq']?></td>
                    <td align="center">
                        <?php
                            $fk
+= $obj->get_freq_dist_table($data)[$row]['freq'];
                            echo
$fk;
                           
$row++;
                       
?>
</td>
                </tr>
            <?php
               
endforeach;
           
?>
</table>
        <?php
           
echo "<br/>";
            echo
"Total data : ".$obj->get_total_data($data)."<br/>";
            echo
"Minimal data : ".$obj->get_min($data)."<br/>";
            echo
"Maksimal data : ".$obj->get_max($data)."<br/>";
            echo
"Rentang data : ".$obj->get_range($data)."<br/>";
            echo
"Jumlah kelas : ".$obj->get_many_classes($data)."<br/>";
            echo
"Panjang per-kelas : ".$obj->get_long_class($data)."<br/>";
            endif;
       
?>
</body>
</html>


  Files folder image Files (2)  
File Role Description
Accessible without login Plain text file raw2table-ex.php Example Example script
Plain text file raw2table.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:258
This week:0
All time:7,831
This week:560Up