Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. extensions [ stats ]
  2.  
  3. to setup
  4. clear-all
  5. crt 5 [ fd 10 ]
  6. end
  7.  
  8. to go
  9. ; Create some data as nested list (two variables for each turtle):
  10. let data [(list xcor ycor)] of turtles
  11.  
  12. ; Create a stats table:
  13. let tbl stats:newtable-from-row-list data
  14.  
  15. ; Calculate a correlation matrix with `stats:correlation`:
  16. let cor-list stats:correlation tbl
  17.  
  18. ; In 2x2 case you can use the second element from the first row to get the coefficient:
  19.  
  20. print item 0 item 1 cor-list
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement