Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: st: AW: problem with -contract-


From   "Karen Wright" <[email protected]>
To   <[email protected]>
Subject   Re: FW: st: AW: problem with -contract-
Date   Wed, 06 Jan 2010 14:06:43 +0000

It is to be used in calculations which require all of the combinations
to be present.

Thank you for the help, your time is most appreciated
Karen

>>> "Martin Weiss" <[email protected]> 06/01/2010 13:08 >>>

<>

With the -zero- option present, I do not think it can be done. Just ask
Stata to tell you the # of obs on the final output (all predicated on my
assumption of three values for your variables - more would exacerbate
the problem).


*******
di  3^165 
*******

Why not use -contract - w/o the option, and say that the remaining
theoretical combinations have zero frequency?

HTH
Martin


-----Original Message-----
From: Karen Wright [mailto:[email protected]] 
Sent: Mittwoch, 6. Januar 2010 13:57
To: Martin Weiss
Subject: RE: st: AW: problem with -contract-

Thank you very much for the explanation.  Am I therefore right in
assuming that it cannot be done?  Unfortunately  it is essential for
my
purposes to include the combinations for which the frequency is zero.

Karen

>>> "Martin Weiss" <[email protected]> 06/01/2010 12:43 >>>

<>

".  I need to use -contract var*, zero-
which is where Stata has a problem with the number of variables."


The -zero- option is indeed the source of your troubles, but the
problem is with the # of observations, not the # of variables. In
fact,
the latter remaines (apart from the _freq variable) unchanged by
-contract-, while the former increases exponentially with every
variable
added. 


Take my example code: My -irecode()- generates a categorical variable
with three values. When I set my memory to 1G, Stata is willing to let
me -contract, zero- on 14 variables, leading to a dataset of -di
%9.0fc
3^14- = 4,782,969 observations. When I add a fifteenth variable,
implying an output dataset comprising -di %12.0fc 3^15- =  14,348,907
obs, Stata refuses to carry out the command.

Note that IC is not necessarily at fault here, since the _number of
observations_ allowed for IC and SE/MP is the same: 2,147,483,647. The
binding constraint here is probably your installed memory...


HTH
Martin


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Karen
Wright
Sent: Mittwoch, 6. Januar 2010 12:29
To: [email protected] 
Subject: RE: st: AW: problem with -contract-

Ah, I see where the problem occurs.  I need to use -contract var*,
zero-
which is where Stata has a problem with the number of variables. 
Although the end result is the same amount of variables as with
-contract-.  It does not work even with -set mem- as high as the
system
will allow.  Indeed running it a few times has shown that it will only
work for approx. 15 variables.




>>> "Martin Weiss" <[email protected]> 06/01/2010 10:51 >>>

<>

Forget the -help whatsnew- part of the last message. If you cannot
-update-, you cannot look at the whatsnew of the update, either.
Still,
the code in the last post should run.


HTH
Martin


-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Martin
Weiss
Sent: Mittwoch, 6. Januar 2010 11:48
To: [email protected] 
Subject: RE: st: AW: problem with -contract-


<>

" Currently I cannot update Stata."

We cannot help you there, but you should be able to run the code below
even with Stata 10.0, or earlier. I simply swapped -runiform()- and
-uniform()-, see -help whatsnew- for "update 11aug2008"...

*******
clear*

vers 9.2

set obs 1000

forv i=1/165{
	gen var`i'=irecode(uniform(), 0, .2, .9, 1)
}

contract var*

su _freq, d
*******


HTH
Martin

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Karen
Wright
Sent: Mittwoch, 6. Januar 2010 11:25
To: [email protected] 
Subject: Re: st: AW: problem with -contract-

Thank you the help is much appreciated but unfortunately I have to
delay
slightly as I am trying to obtain admin rights for my desktop from
IT!!!
 Currently I cannot update Stata.
As you point out Stata should be able to handle the amount of
variables
I am talking about but I am assuming that -contract- must generate
extra
variables in calculating the frequencies?
I shall run the example code you have given me when I am able to
update
Stata and email you then if that would be alright?  Apologies, I do
not
know how long this may take.

Thank you,
Karen

>>> "Martin Weiss" <[email protected]> 05/01/2010 17:52 >>>

<> 

-h limits- (in Stata 10) does indicate that IC can handle 2,047
variables,
though. What happens when you run this example code?



*************
clear*

vers 10.1

set obs 1000

forv i=1/165{
	gen var`i'=irecode(runiform(), 0, .2, .9, 1)
}

contract var*

su _freq, d
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected] 
[mailto:[email protected]] Im Auftrag von Karen
Wright
Gesendet: Dienstag, 5. Januar 2010 18:32
An: [email protected] 
Betreff: st: problem with -contract-

I was wondering if anyone could help with a problem i am having using
-contract-.  I wish to use contract on about 165 variables at the same
time,
this would create a dataset containing 166 variables if contract
worked.
however Stata (of which I am using version 10, IC)  cannot do this due
to
too many variables.  Is there another way to create the frequencies I
require or to alter -contract- in some way to allow this many
variables?

Thank you,
Karen 


The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147
with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.

If
the message is received by anyone other than the addressee, please
return
the message to the sender by replying to it and then delete the
message
from
your computer and network.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 

The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147 with its Registered Office at 123 Old Brompton Road, London SW7
3RP.

This e-mail message is confidential and for use by the addressee only.

If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer and network.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 

The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147 with its Registered Office at 123 Old Brompton Road, London SW7
3RP.

This e-mail message is confidential and for use by the addressee only.

If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer and network.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/ 

The Institute of Cancer Research: Royal Cancer Hospital, a charitable
Company Limited by Guarantee, Registered in England under Company No.
534147 with its Registered Office at 123 Old Brompton Road, London SW7
3RP.

This e-mail message is confidential and for use by the addressee only. 
If the message is received by anyone other than the addressee, please
return the message to the sender by replying to it and then delete the
message from your computer and network.


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search 
*   http://www.stata.com/support/statalist/faq 
*   http://www.ats.ucla.edu/stat/stata/

The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Registered in England under Company No. 534147 with its Registered Office at 123 Old Brompton Road, London SW7 3RP.

This e-mail message is confidential and for use by the addressee only.  If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer and network.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index