<?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 Re: How to simulate a random variable with a known defined correlation to an already existing variab in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302052#M16057</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;yes, it is the correlation coefficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your inputs. But I was seeing the problem in a incorrect way.&amp;nbsp;I want to get a variable from a fixed variable and the correlation between a random variable and a fixed one is zero as one of the users has&amp;nbsp;rightly pointed out.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2016 14:14:00 GMT</pubDate>
    <dc:creator>Evange</dc:creator>
    <dc:date>2016-10-03T14:14:00Z</dc:date>
    <item>
      <title>How to simulate a random variable with a known defined correlation to an already existing variable</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301984#M16049</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am presently developing a Monte Carlo study using SAS. For one of my experimental designs, I need to simulate a random variable, which has to be drawn in such a way that it should respect an a priory defined correlation to an already existing variable. More concretely, I am simulating the difference (error) between list and transaction prices of residential properties, which I assume that&amp;nbsp;is strongly correlated to the size (area) of sold properties (i.e., the bigger the house, the bigger the difference between what it is asked by the seller and what he/she actually gets from the market...).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, I was unable to find advice on how to simulate a random variable with a known defined correlation to an already existing variable. I find examples that simulate all variables but, for my study, I need to simulate a variable (error between list and market price) from an existing one (area). The simulation needs to take into account a pre-defined correlation between the existing and simulated variables (say, 0.9).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to get some advice on how to do this? Suggest some reading?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 08:50:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301984#M16049</guid>
      <dc:creator>Evange</dc:creator>
      <dc:date>2016-10-03T08:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301993#M16050</link>
      <description>&lt;P&gt;Is the known variable assumed to be fixed?&lt;/P&gt;
&lt;P&gt;What is the distribution of the variable that you want to simulate?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 09:48:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301993#M16050</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-10-03T09:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301994#M16051</link>
      <description>&lt;P&gt;Hi, thanks for your prompt interest (I have recently asked for one of your books; still on transit... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; ).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The variable (area) is to remain fixed.&lt;/P&gt;&lt;P&gt;The error (i.e., List Price&amp;nbsp;- Transaction Price)&amp;nbsp;is assumed to be log-normally distributed (i.e., basically the error is always positive; sellers are always asking for more than they actually receive from the market).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to derive a vector of errors, which will be correlated with the area of a property. With this vector I will derive list prices (which I do not have in my dataset): List Price = Transaction Price + Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After this, I will generate data (in a Monte Cralo Study) that will mirror my sample characteristics (which will then have the new simulated List price variable). For doing this, I will follow the procedures described in "SAS for Monte Carlo Studies; A guide for qunatitative researchers".&amp;nbsp;My sample&amp;nbsp;has around 60% of all market transactions carried out in Portugal (2009-2013). I am applying hedonic regression models to describe transaction prices:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ln(transaction prices) = f(characteristics) and would like to know what happens if I use Ln(List price) instead of transaction prices.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks (do not know if this helps; perhaps too much info...).&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 10:27:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/301994#M16051</guid>
      <dc:creator>Evange</dc:creator>
      <dc:date>2016-10-03T10:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302004#M16052</link>
      <description>&lt;PRE&gt;
You mean correlation coefficient ?


data have;
call streaminit(4321);
do id=1 to 10000;
 x=rand('normal');output;
end;
run;
%let rho=0.9;
data want;
 set have;
 call streaminit(1234);
 y=ρ*x+sqrt(1-ρ**2)*rand('normal');
run;
proc corr data=want;
 var x;
 with y;
run;


&lt;/PRE&gt;</description>
      <pubDate>Mon, 03 Oct 2016 11:26:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302004#M16052</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-10-03T11:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302034#M16053</link>
      <description>&lt;P&gt;Covariance is defined for random vectorrs. The covariance between a random vector and a constant vector&amp;nbsp;is zero, since the constant vector doe not vary. So your formulation is not quite correct.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Still, I think I understand your intention. You want to simulate the ListingPrice as a function of the asking price and area. Since you don't have listing prices, you have free parameters to play with, but you should assume a model of some form that includes the area. One choice might be&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;log(ListPrice) = B0 + B1*log(AskingPrice) + B2*sqrt(Area) + epsilon&lt;/P&gt;
&lt;P&gt;but I don't know how how housing prices are usually modeled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notice that the errors are normally distributed, but since you are modeling log(ListPrice), the&amp;nbsp;errors for ListPrice are log-normally distributed. See the article &lt;A href="http://blogs.sas.com/content/iml/2015/09/16/plot-distrib-exp.html" target="_self"&gt;"Error distributions and exponential regression models."&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I suggest that you form some model for log(ListPrice) that incorporates the asking price and the area. &amp;nbsp;If you don't know how to simulate a response for a regression model, see Section 11.3 (especially p. 204) of my book &lt;EM&gt;Simulating Data with SAS.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 13:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302034#M16053</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2016-10-03T13:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302051#M16056</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks. You are right. My formulation is not correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And you have understood&amp;nbsp;what I want to do&amp;nbsp;correctly.&lt;/P&gt;&lt;P&gt;I will now try to model List Prices as a function of Transaction Prices (market prices) and area. And I will look into tyour book since I do not know how to simulate a response variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 14:06:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302051#M16056</guid>
      <dc:creator>Evange</dc:creator>
      <dc:date>2016-10-03T14:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to simulate a random variable with a known defined correlation to an already existing variab</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302052#M16057</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;yes, it is the correlation coefficient.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your inputs. But I was seeing the problem in a incorrect way.&amp;nbsp;I want to get a variable from a fixed variable and the correlation between a random variable and a fixed one is zero as one of the users has&amp;nbsp;rightly pointed out.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 14:14:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-simulate-a-random-variable-with-a-known-defined/m-p/302052#M16057</guid>
      <dc:creator>Evange</dc:creator>
      <dc:date>2016-10-03T14:14:00Z</dc:date>
    </item>
  </channel>
</rss>

