Wednesday, March 31, 2021



         






          dimension x(10)  ,Y(10)
          print*, 'enter value of dimension x'
          do i = 1,10
          read(*,*) x(i)
          end do
          write(*,*) 'Enter the value of the dimension y'
          do j= 1,10
          read(*,*) y(j)
          End do
          sumx=0
          sumy=0
          do i=1,10
            sumx=sumx+x(i)
            sumy=sumy+y(i)
          enddo
          avex=sumx/10.0
          avey=sumy/10.0
          sum1=0
          sum2=0
          spxy=0
          do i=1,10
            sum1=sum1+(x(i)-avex)**2
            sum2=sum2+(y(i)-avey)**2
            spxy=spxy+(x(i)-avex)*(y(i)-avey)
         end do
         correlation= spxy/sqrt(sum1*sum2)
         Byx=spxy/sum1
         A=avey-(Byx*avex)
         print*, 'the value of corr',correlation,'      ','Byx is=',Byx
         print*, 'and the value of coffecient A is =', a
         print*, 'average of x is', avex,'    ',' and average of y is',avey
         stop
         end

No comments:

Post a Comment