turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Health Care and Pharma
- /
- SAS in Health Care Related Fields
- /
- number of cycles and length of each cycle

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

05-23-2011 06:56 PM

How is it possible to determine the number of estrous cycles in dogs when the occurrence of the cycle is given.

For instance, when the determinants of the cycle is given by DI,PR,ES,ME,S,P where DI=diestrus,PR=Proestrus,ES=estrus,ME=metestrus,S=sperm,P=plug.

The occurrence of estrus is only that matters and the cycle is given by EST DI DI DI MET EST -- here the length of the cycle is 5 until the occurrence of next estrus.

A cycle is calculated from one estrus to another estrus. The length of the cycle is the period until next estrus occurs which is 5 in the above case.

How do I write a code to calculate this in Statistics. The endpoint is to calculate the number of cycles and length of each cycle.

The output has to look like this:

animal_id cycle1 cycle2 cycle3

101 5 3 2

102 2 3 1

103 3 1 2

For instance, when the determinants of the cycle is given by DI,PR,ES,ME,S,P where DI=diestrus,PR=Proestrus,ES=estrus,ME=metestrus,S=sperm,P=plug.

The occurrence of estrus is only that matters and the cycle is given by EST DI DI DI MET EST -- here the length of the cycle is 5 until the occurrence of next estrus.

A cycle is calculated from one estrus to another estrus. The length of the cycle is the period until next estrus occurs which is 5 in the above case.

How do I write a code to calculate this in Statistics. The endpoint is to calculate the number of cycles and length of each cycle.

The output has to look like this:

animal_id cycle1 cycle2 cycle3

101 5 3 2

102 2 3 1

103 3 1 2

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to saslover

05-24-2011 02:42 AM

Give me an example how your data looks like..

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sudhakar_A

05-24-2011 05:39 AM

It has many variables. But the variable of interest has observations that look like this

Est

Di

Met

Sp

Est

and so on

Est

Di

Met

Sp

Est

and so on

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to saslover

05-24-2011 06:03 AM

Is there any other variables which is useful to keep the same order of the records even if you sort it.

we can do it 2 ways by transposing or in the dataset with common by variable.

we can do it 2 ways by transposing or in the dataset with common by variable.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sudhakar_A

05-24-2011 06:28 AM

here you go

data hj;

input cat $15.;

datalines;

Est

Di

Met

Sp

Est

di

met

met

sp

gh

est

kk

lk

kk

jh

;

run;

data tjk;

set hj;

if upcase(cat)="EST" then newcy+1;

run;

proc freq data =tjk noprint;

tables newcy/out=tnum (drop=percent);

run;

proc transpose data=tnum out=tdurm prefix=cycle;

var count;

id newcy;

run;

if you want you can use the animal id as the by variable in all the steps

Sudhakar

data hj;

input cat $15.;

datalines;

Est

Di

Met

Sp

Est

di

met

met

sp

gh

est

kk

lk

kk

jh

;

run;

data tjk;

set hj;

if upcase(cat)="EST" then newcy+1;

run;

proc freq data =tjk noprint;

tables newcy/out=tnum (drop=percent);

run;

proc transpose data=tnum out=tdurm prefix=cycle;

var count;

id newcy;

run;

if you want you can use the animal id as the by variable in all the steps

Sudhakar

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sudhakar_A

05-24-2011 09:34 AM

I tried using your code.. but it has so many missing values and I would be unable to delete them.

Also the output has to look like this

animl_no cycle1 cycle2 cycle3

101 2 2 3

There are more than 400 cycles here, but in reality there are not more than 10 cycles. I have no clue how you get the 400 cycles.

Also the output has to look like this

animl_no cycle1 cycle2 cycle3

101 2 2 3

There are more than 400 cycles here, but in reality there are not more than 10 cycles. I have no clue how you get the 400 cycles.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to saslover

05-25-2011 08:04 AM

Can you give me the part of your observation with animal_id and other important variable which need to derive the cycle