text files - How do I load data into Win Bugs from Excel or from Notepad (doc ending with .txt)? -


i need load data winbugs excel , reason, winbugs doesn't recognize it. there many things have tried (all of listed below) , none of these work.

  1. i tried copy excel , 'paste special' 'plain text' winbugs. added [] after every variable , 'end' @ end. error message came follows:

    sorry went wrong in procedure loadnumeric data in module bugrectdata

  2. i copied , pasted notepad, added [] after every variable , 'end' @ end again , removed space between lines, , 1 space between each data. when dragged winbugs, dispersed double space between lines , large gaps between data , error message came (when trying load data):

    sorry went wrong in procedure loadnumeric data in module bugrectdata

  3. the last thing did open .txt file winbugs , became jumbled , when tried load data, instead highlighted data such na2.0 should have been na 2.0 , said "expected number or na or end". after correcting these mistakes, data seemed fine until end said 'end' , said same thing highlighting e on end.

if give insight grateful.

it easier answer if had included part of dataset, have included in winbugs compound document. stated in winbugs manual (http://www.mrc-bsu.cam.ac.uk/bugs/winbugs/manual14.pdf) data can entered in s-plus format or in rectangular format. rectangular format has form:

y[] x[] 5 4.1 3 2.1 4 3.5 end  

s-plus format (as example):

list(y=c(5,3,4),x=c(4.1,2.1,3.5)) 

have tried these , full correct syntax? in rectangular format arrays must of equal length, , must have heading.

i wouldn't direct copy/paste excel winbugs since kinds of strange formatting can come along. try copy data .txt first or save tab spaced .csv. check file looks ok before insert winbugs, using e.g 'paste special' , plain text.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -