Welcome, guest | Sign In | My Account | Store | Cart

Calculation of LD50 and LD90 with Statlib

Python, 118 lines
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#donyo@abv.bg
from statlib import anova



choice=None

def ld():

      num_ob=input('Enter the number of observations: ')



      dose=[0]*num_ob

      response=[0]*num_ob

      

      index=0

      while index<num_ob:

                  print index+1

                  dose [index]=input('Enter the values of the doses: ')

                  index+=1

      print \

           """

     """

      index1=0

      while index1<num_ob:

            print index1+1

            response [index1]=input('Enter the values of the response (effectiveness): ')

            index1+=1



     

      res=anova.linregress(dose, response)

      ld50=(50-res[1])/res[0]

      ld90=(90-res[1])/res[0]

      

      

    

      print \

            """

      """

           

      print "R value is: ", res[2]

      print \

            """

      """

      print "LD 50 value is: ", ld50

      print "LD 90 value is: ", ld90

            



while choice!="0":

      print \

      """

     LD50 and LD90 Calculation Program



     Used module: Python - Statlib



     Created by Donyo Ganchev, Agricultural University, Plovdiv, Bulgaria

     

     1 - Begin calculation

     0 - Exit

     """

      choice= raw_input("Choice: ")

      if choice == "0":

                  exit()

      elif choice=="1":

             ld ()
Created by donyo Ganchev on Fri, 8 May 2009 (MIT)
Python recipes (4591)
donyo Ganchev's recipes (11)

Required Modules

  • (none specified)

Other Information and Tasks