<?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: Bilinear interpolation in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636184#M188967</link>
    <description>&lt;P&gt;I don't get the suggestion of LOESS or RSREG, the question specifically asks for linear interpolation.&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2020 11:53:43 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-03-31T11:53:43Z</dc:date>
    <item>
      <title>Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635863#M188844</link>
      <description>&lt;P&gt;Is it possible to do bilinear interpolation in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For interpolation in one dimension I found that this can be easily done using the "proc expand" or a "proc transreg" (link:&amp;nbsp;&lt;A href="https://support.sas.com/kb/24/560.html" target="_blank" rel="noopener"&gt;https://support.sas.com/kb/24/560.html&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, for the case where I have 2 "input variables (x,y)" and one "output variable (z)" I have not found a good procedure.&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;Are there any good procedures to do bilinear interpolation in SAS?&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Additional clarification on what I mean with "bilinear interpolation"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;With bilinear I am aiming to the meaning that it has on WikiPedia (&lt;A href="https://en.wikipedia.org/wiki/Bilinear_interpolation" target="_blank" rel="nofollow noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Bilinear_interpolation&lt;/A&gt;). This means that I have a list of (x,y,z) values, and that I am looking for some function that can fill in the missing z-values if I provide the missing z-values if I provide a list of (x,y) values within the range of the original provided values.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Interpolation methods that would be a great fit for my purpose:&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;bilinear interpolation:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Bilinear_interpolation" target="_blank" rel="nofollow noopener noreferrer"&gt;https://en.wikipedia.org/wiki/Bilinear_interpolation&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;bicubic interpolation:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Bicubic_interpolation" target="_blank"&gt;https://en.wikipedia.org/wiki/Bicubic_interpolation&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;nearest-neighbours interpolation:&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation" target="_blank"&gt;https://en.wikipedia.org/wiki/Nearest-neighbor_interpolation&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;EM&gt;Although the latter one I personally do not prefer, it could also provide a solution to my problem.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Examples from other programming languages&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Examples of the function I am looking for can also be found in other programming languages. All the examples accept a list of (X, Y, Z) values, together with a list of (X0, Y0) values for which the (Z) values are then determined so these can be added to a table.&lt;/EM&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;EM&gt;MATLAB example (interp2):&amp;nbsp;&lt;A href="https://nl.mathworks.com/help/matlab/ref/interp2.html" target="_blank"&gt;https://nl.mathworks.com/help/matlab/ref/interp2.html&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;Python example (interp2d):&amp;nbsp;&lt;A href="https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.interp2d.html" target="_blank"&gt;https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.interp2d.html&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;R example (interp2):&amp;nbsp;&lt;A href="https://www.rdocumentation.org/packages/pracma/versions/1.9.9/topics/interp2" target="_blank"&gt;https://www.rdocumentation.org/packages/pracma/versions/1.9.9/topics/interp2&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;LI&gt;&lt;EM&gt;C++ example (libInterpolate):&amp;nbsp;&lt;A href="https://github.com/CD3/libInterpolate" target="_blank"&gt;https://github.com/CD3/libInterpolate&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Tue, 31 Mar 2020 05:20:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635863#M188844</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-03-31T05:20:17Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635864#M188845</link>
      <description>&lt;P&gt;Is a regression model an option?&lt;/P&gt;
&lt;P&gt;PROC GLM?&lt;/P&gt;
&lt;P&gt;Or RSREG?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 16:19:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635864#M188845</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-03-30T16:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635943#M188868</link>
      <description>&lt;P&gt;If you have licence for SAS/GRAPH, look at the G3GRID procedure. It does linear, spline and smooth interpolations over a grid.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 19:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635943#M188868</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-03-30T19:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635952#M188873</link>
      <description>&lt;P&gt;I guess this all depends on the meaning of "bilinear", which wasn't specified in the original question, but my guessing is that splines are not "bilinear". Linear regression with 2 Xs (and only the linear terms) is what I think "bilinear" means.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Mar 2020 19:45:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/635952#M188873</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-30T19:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636077#M188903</link>
      <description>&lt;P&gt;Hi PaigeMiller,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With bilinear I am aiming to the meaning that it has on WikiPedia (&lt;A href="https://en.wikipedia.org/wiki/Bilinear_interpolation" target="_blank"&gt;https://en.wikipedia.org/wiki/Bilinear_interpolation&lt;/A&gt;). This means that I have a list of (x,y,z) values, and that I am looking for some function that can fill in the missing z-values if I provide the missing z-values if I provide a list of (x,y) values within the range of the original provided values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the advice, I will adjust my question to avoid all unclarities.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 05:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636077#M188903</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-03-31T05:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636078#M188904</link>
      <description>Just to clarify on what I mean with bilinear.&lt;BR /&gt;&lt;BR /&gt;With bilinear I am aiming to the meaning that it has on WikiPedia (&lt;A href="https://en.wikipedia.org/wiki/Bilinear_interpolation" target="_blank"&gt;https://en.wikipedia.org/wiki/Bilinear_interpolation&lt;/A&gt;). This means that I have a list of (x,y,z) values, and that I am looking for some function that can fill in the missing z-values if I provide the missing z-values if I provide a list of (x,y) values within the range of the original provided values.</description>
      <pubDate>Tue, 31 Mar 2020 05:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636078#M188904</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-03-31T05:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636080#M188905</link>
      <description>Hi Reeza,&lt;BR /&gt;&lt;BR /&gt;Thank you for the suggestion! My personal drawback on this, is that I have a list of numbers (x, y, z) which we know to be exact. The goal is to estimate the z value for a new point (x,y). The function should pass trough the original numbers (x, y, z), as they are exact, and interpolate these number linearly (or in a smoothed way).</description>
      <pubDate>Tue, 31 Mar 2020 05:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636080#M188905</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-03-31T05:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636081#M188906</link>
      <description>Hi PGStats,&lt;BR /&gt;&lt;BR /&gt;I indeed saw the G3GRID procedure in my search, and this is in our licence.&lt;BR /&gt;&lt;BR /&gt;However after reading the documentation I only found examples to make graphs. My goal is to add the z-value to a table of (x,y) values. Where the z-value is determined by an interpolation of a given (x, y, z) table. I am not sure if the G3GRID procedure can do this?</description>
      <pubDate>Tue, 31 Mar 2020 05:12:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636081#M188906</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-03-31T05:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636153#M188947</link>
      <description>&lt;P&gt;PROC GLM will do this. It also allows for the prediction/interpolation of values of z for different values of (x,y) that were not used to build the model.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 10:34:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636153#M188947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-31T10:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636168#M188959</link>
      <description>&lt;P&gt;It seems like imputing MISSING value.&lt;/P&gt;
&lt;P&gt;Did you check PROC MI ?&lt;/P&gt;
&lt;P&gt;Calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 11:11:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636168#M188959</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-03-31T11:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636173#M188961</link>
      <description>&lt;P&gt;IMHO, you should fit a parametric model (PROC RSREG) or a nonparametric model (PROC LOESS) to the data. If these are spatial data, then there are specialized routines (such as PROC KRIGE) that you can use to model the response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 11:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636173#M188961</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-03-31T11:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636184#M188967</link>
      <description>&lt;P&gt;I don't get the suggestion of LOESS or RSREG, the question specifically asks for linear interpolation.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 11:53:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636184#M188967</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-03-31T11:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636211#M188987</link>
      <description>&lt;P&gt;Yes, I am suggesting these as alternatives to the OP's request for linear interpolation. Also, my suggestions are smoothers; they do not necessarily pass through the data points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The LOESS method has a SCORE statement that you can use to score new data:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Grid;
call streaminit(12345);
do x = 0 to 10 by 2;
   do y = 0 to 10 by 2;
      z = abs(x-5) + abs(y-5) + round(rand("Normal"), 0.1);
      output;
   end;
end;
run;

data New;
do x = 1 to 9 by 2;
   do y = 1 to 9 by 2;
      output;
   end;
end;

proc loess data=Grid plots(only)=contourfit;
   model z = x y / degree=1;
   score data=New / print;
   ods exclude ScoreResults;
   ods output ScoreResults = ScoreOut;
run;

proc print data=ScoreOut(obs=10);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 12:56:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636211#M188987</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-03-31T12:56:34Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636295#M189018</link>
      <description>&lt;P&gt;To quote the documentation for proc G3GRID:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;The G3GRID procedure does not produce &lt;SPAN class="ng-scope" data-gloss-modified="" data-gloss-item="1"&gt;&lt;A class="glossLink ng-scope" href="https://documentation.sas.com/" target="_blank"&gt;&lt;SPAN class="xisDoc-glossTerm ng-scope" data-gloss-term="1"&gt;graphics output&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;. PROC G3GRID produces an output data set that you can use as the input data set for PROC G3D or PROC GCONTOUR.&lt;/EM&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 31 Mar 2020 16:56:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636295#M189018</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-03-31T16:56:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636300#M189021</link>
      <description>&lt;P&gt;I just re-read the OP's comment that says&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;I indeed saw the G3GRID procedure in my search, and &lt;STRONG&gt;this is in our license&lt;/STRONG&gt;."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The first time I read it, I mistakenly thought the OP said that G3GRID &lt;STRONG&gt;wasn't&lt;/STRONG&gt;&amp;nbsp;licensed. If you have PROC G3GRID, it provides linear interpolation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2020 17:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/636300#M189021</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-03-31T17:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639785#M190398</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the many responses. My hope was that there would be an easy method that constructed an interpolation(x, y) function (as is the case in the examples in Python, R, MATLAB and C++ shown in the original question). If I read the different responses correctly, this is not possible at all, am I correct with this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The popular G3GRID method that is suggested does&amp;nbsp;&lt;EM&gt;not&lt;/EM&gt;&amp;nbsp;seem to meet my criteria. The reason is that I have irregularly spaced datapoints that I wish to determine. This appears to be impossible using this method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The MI method seems promising at first sight. However I only see examples where the imputation is done by either the "mean value" or by a "regression result". The documentation of this method does not discuss "interpolation".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current "quick and dirty" workaround is by using the "proc discrim" procedure, to essentially do 1-nearest neighbour interpolation. This gives me the value of the nearest point as the "interpolation". This is a workable solution at the moment for me, although it is far from ideal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As a recap: I have a series of regularly spaced (x0, y0, z0) values. I also have a (very large) series of irregularly spaced (x, y) values for which I want to determine the corresponding z values.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 14:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639785#M190398</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-04-14T14:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639789#M190400</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/283816"&gt;@NickVe&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Dear all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the many responses. My hope was that there would be an easy method that constructed an interpolation(x, y) function (as is the case in the examples in Python, R, MATLAB and C++ shown in the original question). If I read the different responses correctly, this is not possible at all, am I correct with this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;PROC GLM does this. Which was mentioned earlier in this thread.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 14:58:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639789#M190400</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-04-14T14:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639799#M190401</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;If I read the different responses correctly, this is not possible at all, am I correct with this?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I would not say that is a correct statement. It is possible by using programming statements. The difficulty seems to be that the built-in SAS procedures that we have suggested have been rejected by you for various reasons. If I remember correctly, you do not want a global (or even local) statistical fit but want a bilinear fit based on values at the corner of the cell (in a regular grid) in which each point lives.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've written about &lt;A href="https://blogs.sas.com/content/iml/2013/07/17/2d-binning.html" target="_self"&gt;how to use 2-D binning&lt;/A&gt; to find the cell that each point belongs to. If you are a programmer, such a routine can be programmed in the SAS/IML language by using &lt;A href="https://en.wikipedia.org/wiki/Bilinear_interpolation" target="_self"&gt;the definition of bilinear interpolation.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 15:08:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639799#M190401</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-04-14T15:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639990#M190485</link>
      <description>&lt;P&gt;If I read the documentation correctly, "proc GLM" only provides a "linear fit", not an "interpolation" as is asked in the original question. Please correct me if I misread this.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 06:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/639990#M190485</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-04-15T06:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Bilinear interpolation in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/640006#M190500</link>
      <description>&lt;P&gt;This 2D binning article looks indeed promosing workaround to generate a regular grid from my irregularly spaced data. This could then be combined with the G3GRID method proposed above. Note however that this is still a workaround and technically not a solution to my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The reason for rejecting the previous methods are that they do not answer the question:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;"proc GLM" provides a "fit", not an "interpolation" as requested&lt;/LI&gt;&lt;LI&gt;"RSREG" provides a "fit", not an "interpolation" as requested&lt;/LI&gt;&lt;LI&gt;G3GRID only works for "regular grids", not irregularily shaped data as requested&lt;/LI&gt;&lt;LI&gt;"PROC MI" seems only to do missing imputation, not "interpolation"&lt;/LI&gt;&lt;LI&gt;"PROC LOESS" provides a "fit", not an "interpolation" as requested&lt;/LI&gt;&lt;LI&gt;"PROC KRIGE" performs krigging, with is again a "fit", not an "interpolation" as requested&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;The closest solution to my problem I have found seems to be the "proc discrim" method, which I use to make a 1NN interpolation. The advantage is that this meets the criteria of my question:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I can provide a "train" dataset of (X0, Y0, Z0) values&lt;/LI&gt;&lt;LI&gt;I can easily provide new values (X, Y) and obtain the corresponding (Z) values&lt;/LI&gt;&lt;LI&gt;This works for data that is &lt;EM&gt;not&lt;/EM&gt; on a rectangular grid&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;For me personally this is the most viable solution at the moment. Unfortunately this only fits the nearest point, and does not perform linear interpolation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I understand that I could write my own program in SAS to solve this issue, however that was not the question. I wanted to avoid "re-inventing the wheel" by working with the optimized SAS procedures as much as possible. My belief was that these "interpolation functionalities" would also be available in SAS since they are available in for example MATLAB, R, Python and C++ (see examples).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 07:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Bilinear-interpolation-in-SAS/m-p/640006#M190500</guid>
      <dc:creator>NickVe</dc:creator>
      <dc:date>2020-04-15T07:23:30Z</dc:date>
    </item>
  </channel>
</rss>

