<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic insufficient memory with cluster in surveyreg in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793816#M254472</link>
    <description>&lt;P&gt;Hello, I am running the following regression for a sample of 104,000 observations (some are omitted because of missing values).&lt;/P&gt;
&lt;P&gt;I want to add clusters by firm (there are approx.1700 firms in the sample ). I already tried to increase the memsize manually to 6G, but with no luck.&lt;/P&gt;
&lt;P&gt;I tried both locally and via WRDS servers.&lt;/P&gt;
&lt;P&gt;This is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro reg_s(var_name, data_name);
proc surveyreg data=&amp;amp;data_name;
cluster gvkey;
CLASS gvkey year_data;
MODEL &amp;amp;var_name=incu_post_ipo sign_inc_p sign_p sale_rank market_share ind_code_count gvkey year_data /SOLUTION;
ods output ParameterEstimates=&amp;amp;var_name._&amp;amp;data_name;
RUN; 
ods trace off;

%mend;


%reg_s(capx_1,ff);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the error output:&lt;/P&gt;
&lt;PRE&gt;NOTE: In data set FF, total 104383 observations read, 43366 observations with missing values are
      omitted.
ERROR: The SAS System stopped processing this step because of insufficient memory.
NOTE: PROCEDURE SURVEYREG used (Total process time):
      real time           1.06 seconds
      user cpu time       0.89 seconds
      system cpu time     0.10 seconds
      memory              51160.06k
      OS Memory           77100.00k
      Timestamp           01/02/2022 04:54:23 àçäØö
      Step Count                        20  Switch Count  0

2452  run;



&lt;/PRE&gt;
&lt;P&gt;P.S when I run the code without the clusters this is what I get:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: In data set FF, total 104383 observations read, 43366 observations with missing values are
      omitted.
NOTE: The data set WORK.CAPX_1_FF has 1127 observations and 6 variables.
NOTE: PROCEDURE SURVEYREG used (Total process time):
      real time           42.59 seconds
      user cpu time       39.06 seconds
      system cpu time     0.87 seconds
      memory              101172.81k
      OS Memory           126420.00k
      Timestamp           01/02/2022 05:06:44 àçäØö
      Step Count                        22  Switch Count  819


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I already read some relevant Q&amp;amp;A but couldn't find an answer to my case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2022 15:10:49 GMT</pubDate>
    <dc:creator>margalits1</dc:creator>
    <dc:date>2022-02-01T15:10:49Z</dc:date>
    <item>
      <title>insufficient memory with cluster in surveyreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793816#M254472</link>
      <description>&lt;P&gt;Hello, I am running the following regression for a sample of 104,000 observations (some are omitted because of missing values).&lt;/P&gt;
&lt;P&gt;I want to add clusters by firm (there are approx.1700 firms in the sample ). I already tried to increase the memsize manually to 6G, but with no luck.&lt;/P&gt;
&lt;P&gt;I tried both locally and via WRDS servers.&lt;/P&gt;
&lt;P&gt;This is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro reg_s(var_name, data_name);
proc surveyreg data=&amp;amp;data_name;
cluster gvkey;
CLASS gvkey year_data;
MODEL &amp;amp;var_name=incu_post_ipo sign_inc_p sign_p sale_rank market_share ind_code_count gvkey year_data /SOLUTION;
ods output ParameterEstimates=&amp;amp;var_name._&amp;amp;data_name;
RUN; 
ods trace off;

%mend;


%reg_s(capx_1,ff);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the error output:&lt;/P&gt;
&lt;PRE&gt;NOTE: In data set FF, total 104383 observations read, 43366 observations with missing values are
      omitted.
ERROR: The SAS System stopped processing this step because of insufficient memory.
NOTE: PROCEDURE SURVEYREG used (Total process time):
      real time           1.06 seconds
      user cpu time       0.89 seconds
      system cpu time     0.10 seconds
      memory              51160.06k
      OS Memory           77100.00k
      Timestamp           01/02/2022 04:54:23 àçäØö
      Step Count                        20  Switch Count  0

2452  run;



&lt;/PRE&gt;
&lt;P&gt;P.S when I run the code without the clusters this is what I get:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: In data set FF, total 104383 observations read, 43366 observations with missing values are
      omitted.
NOTE: The data set WORK.CAPX_1_FF has 1127 observations and 6 variables.
NOTE: PROCEDURE SURVEYREG used (Total process time):
      real time           42.59 seconds
      user cpu time       39.06 seconds
      system cpu time     0.87 seconds
      memory              101172.81k
      OS Memory           126420.00k
      Timestamp           01/02/2022 05:06:44 àçäØö
      Step Count                        22  Switch Count  819


&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I already read some relevant Q&amp;amp;A but couldn't find an answer to my case.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 15:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793816#M254472</guid>
      <dc:creator>margalits1</dc:creator>
      <dc:date>2022-02-01T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory with cluster in surveyreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793832#M254481</link>
      <description>&lt;P&gt;I am not an expert in survey regression, but are you sure you want to include gvkey (the clustering variable) on the MODEL statement?&amp;nbsp; I noticed in the documentation examples, the variable on the CLUSTER statement is not included on the MODEL statement.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2022 15:54:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793832#M254481</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2022-02-01T15:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory with cluster in surveyreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793971#M254536</link>
      <description>I want to have both fixed effects and clustering for gvkey (the firm). &lt;BR /&gt;Perhaps I should use a different model then?&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Feb 2022 07:09:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793971#M254536</guid>
      <dc:creator>margalits1</dc:creator>
      <dc:date>2022-02-02T07:09:51Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory with cluster in surveyreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793996#M254549</link>
      <description>&lt;P&gt;Please post the result of&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc options group=memory;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and some information about the hardware used: how much memory is installed, how much is free?&lt;/P&gt;
&lt;P&gt;It seems strange that the first run terminates with ~50% memory used, compared with the second run.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 12:21:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/793996#M254549</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-02-02T12:21:00Z</dc:date>
    </item>
    <item>
      <title>Re: insufficient memory with cluster in surveyreg</title>
      <link>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/794173#M254622</link>
      <description>Thanks for your reply,&lt;BR /&gt;I actually read a bit more and found that indeed surveyreg has memory issues with clusters, and now use GENMOD instead, which captures both f.e and two-way cluster, just as I wanted.&lt;BR /&gt;Thanks again</description>
      <pubDate>Thu, 03 Feb 2022 09:51:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/insufficient-memory-with-cluster-in-surveyreg/m-p/794173#M254622</guid>
      <dc:creator>margalits1</dc:creator>
      <dc:date>2022-02-03T09:51:55Z</dc:date>
    </item>
  </channel>
</rss>

