SAS take home exam .docx

Write a data step to create a dataset that have

This preview shows page 2 out of 2 pages.

Write a data step to create a dataset that have difference between the first and last profit. Note that created data set by your code must have one variable for difference and one observation Procimport datafile = 'C:\Users\Denis.Krayets54\Desktop\Second test.xlsx' out =ProfDiff dbms =xlsx; sheet =profit; run ; data ProfDiff2( drop =_profit); set ProfDiff(firstobs=min); set ProfDiff( rename =(profit=_profit)) nobs =_nobs_ point =_nobs_; Diff= _profit-profit; drop profit; output ; stop ; run ; Q5. The worksheet animalshave weights (in kg) of animals in the second row. The names of animals in the first row of the worksheet should be used as the variables’ names for the code. Write the data step that createsone variable that should have the name of animals that are 200 kg or heavier than 200 kg. Procimport datafile = 'C:\Users\Denis.Krayets54\Desktop\Second test.xlsx' out =weight dbms =xlsx replace; sheet =animals; range = "animals$A1:P2" ; run ; data animals; set weight; array animal(*) _numeric_ ; do i= 1 to dim(animal); if animal(i)>= 200. thendo ; name=vname(animal(i)); drop dog -- i; output ; end ; end ; run ;
Image of page 2
You've reached the end of this preview.
  • Fall '15
  • singh
  • Statistics, Computer program, Natural number

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern