number of cycles and length of each cycle

Reply
Occasional Contributor
Posts: 13

number of cycles and length of each cycle

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
Contributor
Posts: 60

Re: number of cycles and length of each cycle

Give me an example how your data looks like..
Occasional Contributor
Posts: 13

Re: number of cycles and length of each cycle

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

Est
Di
Met
Sp
Est

and so on
Contributor
Posts: 60

Re: number of cycles and length of each cycle

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.
Contributor
Posts: 60

Re: number of cycles and length of each cycle

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
Occasional Contributor
Posts: 13

Re: number of cycles and length of each cycle

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.
Contributor
Posts: 60

Re: number of cycles and length of each cycle

Can you give me the part of your observation with animal_id and other important variable which need to derive the cycle
Post a Question
Discussion Stats
  • 6 replies
  • 540 views
  • 0 likes
  • 2 in conversation