Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: klkot
  • Order by date
  1. klkot

    generate treatment&control with perl

    Thanks! You were right. It was redundant. I redid with more thought and didn't need to create any hashes or arrays. I was just making things much harder than necessary. Sorry and thanx a lot ~klkot
  2. klkot

    generate treatment&control with perl

    Okay thanks Kevin So I created it how *I think* it should look but there's something wrong with the way I've created the hash. Do you know what I've done wrong? Here's my whole code: open(FH ,"/home/kotterkl/nsqipfakedata")||die "Couldn't open infile"; open(OUTFILE...
  3. klkot

    generate treatment&control with perl

    Hi again Perl gurus I've created the following Perl script to generate groups of test (T) and development (D) or "treatment and control" with the flip of a coin so to speak divided according to a list of a fake case Id's. So the first perl script I've written to do the simple task of: fakeid...
  4. klkot

    problem calculating on nils

    Prex1 This is extremely valuable advice that I comprehend and for that I'm giving you a star for perlmeister of the week! ;0 Cheers, klkot
  5. klkot

    add consecutive missing keys in a hash

    Thanks prex1. I managed to use kevin's first code and it seemed to work but I see yours is very good and advanced (maybe a little too advanced for me;) Thanks as well prex1 ~klkot
  6. klkot

    add consecutive missing keys in a hash

    Thanks Kevin I hope you win for Perl-meister of the week so I gave you a star! You make hard things easy and you've been a great help so far. I might have to post again if I can't get it to go through properly tomorrow but it looks like it'll work Cheers Kevin ;) klkot
  7. klkot

    add consecutive missing keys in a hash

    I know patientid should go from 1101-1241 consecutively but there happen to be missing observations for patientid in the actual dataset. I want to add the missing rows. Thanks Kevin!
  8. klkot

    add consecutive missing keys in a hash

    Hi again Perl gurus. I've used the following code which produces the output I want where patientid is the key and each file has three values so the output looks like: Patientid Var1File1 Var2File1 Var3File1 Var1File2...... 1200 val val val val 1203 val...
  9. klkot

    problem calculating on nils

    Okay thanks Miller! You know your stuff. Now I'm going to add another challenging question to the Perl forum.....
  10. klkot

    problem calculating on nils

    And by the way THANKS AGAIN MILLER! ;)
  11. klkot

    problem calculating on nils

    Hi again Miller Yeah I fixed it with conditionals. They set up the code so that when you sum things, even if you're summing all nils, it sums 0. I'm realizing that is just another sort of frustrating thing that Perl does that you have to go over with with conditionals to fix :(
  12. klkot

    problem calculating on nils

    Using a function such as the one below causes the issue of assuming that if all the intdaymiss i's were nil (missing), it manages to calculate the sum to be 0 rather than nil. Do you know what to do to make sure it sums all nils to stay nil? $megahash{$patientid[$i]}{$filename}[$dmindx] +=...
  13. klkot

    hash merge?

    Miller and Kevin What can I say other than: you people ROCK! Thanks for the valuable advice. Both of your codes have helped me form my solution. If you want to see my final solution I would be happy to show you... Can't thank you enough! ~klkot two stars for the two of you :)
  14. klkot

    hash merge?

    Hey I thanked Miller for giving a helpful post. He/she was right. I gave a star or whatever to thank Miller. And sorry I didn't say anything about your post Kevin but I wasn't looking for the output you gave in your code. The output I wanted was one patient id PER row and I finally figured...
  15. klkot

    hash merge?

    The following file I created works to create the dataset I want for each file individually. I would have loaded each file and the two separate datasets would come out like this: Medication 1 Dataset Patientid Adhash{patientid} 1223 .95 1224 .56 1225 .78 1226 .99...
  16. klkot

    calculating on hashes?

    Thanks Miller. I used the == but it still was not able to print the adhash. Does anyone know the code to make the output print in the form I want it to? I really appreciate it any advice ;)
  17. klkot

    calculating on hashes?

    I'm very new to Perl and trying to get things to work. I'm working with a dataset that originally looks like this: ID Intdaymiss Daysobs 2611 . 12 2611 5 28 2612 . 0 2613 0 . 2613 5...
  18. klkot

    new to perl: translating my sas algorithms

    Just looked at Perl for the first time this week. Originally a SAS programmer so trying to translate sas code that worked into perl code for data management. This is sort of complicated so wondering how I might fix the errors? Thanks! I put the following code in and it does not work. Steps I...

Part and Inventory Search

Back
Top