<?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 Perform Operations on a Column? in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617371#M8671</link>
    <description>&lt;P&gt;Then you need post it at IML forum and Calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could try SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt; select RowPlusNoise - mean(RowPlusNoise) as md2_RPN&lt;BR /&gt;  from mean_dev ;&lt;BR /&gt;quit;&lt;/PRE&gt;</description>
    <pubDate>Wed, 15 Jan 2020 05:15:23 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2020-01-15T05:15:23Z</dc:date>
    <item>
      <title>How to Perform Operations on a Column?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617370#M8670</link>
      <description>&lt;P&gt;Hi SAS helpers!&lt;/P&gt;&lt;P&gt;Very new to SAS. Using SAS University Edition. Tried searching and kept finding documents about PROC MEANS and similar. What I want to do is perform operations on a column, such as subtracting the mean. What I was expecting was vectorized arithmetic. What I got was something else.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc import datafile='/folders/myfolders/mean_dev_example.xlsx' 
     out = mean_dev
     dbms = xlsx
     replace;
run;

* Subtract mean from RowPlusNoise so it looks like md_RPN;
* This is a variation on what I tried;
data mean_dev;
     set mean_dev;
     md2_RPN = RowPlusNoise - mean(RowPlusNoise);
proc print mean_dev;
run;&lt;/PRE&gt;&lt;P&gt;What I get is a column of zeros? This should be straight forward. I just don't know what I'm doing. Please assist!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Rgds.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 04:35:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617370#M8670</guid>
      <dc:creator>schlepro</dc:creator>
      <dc:date>2020-01-15T04:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Operations on a Column?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617371#M8671</link>
      <description>&lt;P&gt;Then you need post it at IML forum and Calling &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could try SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;&lt;BR /&gt;create table want as&lt;BR /&gt; select RowPlusNoise - mean(RowPlusNoise) as md2_RPN&lt;BR /&gt;  from mean_dev ;&lt;BR /&gt;quit;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 05:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617371#M8671</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-01-15T05:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Operations on a Column?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617372#M8672</link>
      <description>&lt;P&gt;There is proc stdize for this specific purpose:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input row	rowplusnoise;
datalines;
1 1.479076657
2 2.295673384
3 3.36174835
4 4.430062053
5 5.592595732
6 6.056510293
7 7.119216833
8 8.510822811
9 9.410188941
10 10.74169849
;

proc stdize data=have out=want method=mean oprefix=o_ sprefix=centered_;
var rowplusnoise;
run;

proc print data=want; run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;Obs. 	row 	o_rowplusnoise 	centered_rowplusnoise
1 	1 	1.4791 	-4.42068
2 	2 	2.2957 	-3.60409
3 	3 	3.3617 	-2.53801
4 	4 	4.4301 	-1.46970
5 	5 	5.5926 	-0.30716
6 	6 	6.0565 	0.15675
7 	7 	7.1192 	1.21946
8 	8 	8.5108 	2.61106
9 	9 	9.4102 	3.51043
10 	10 	10.7417 	4.84194&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Jan 2020 05:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617372#M8672</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-01-15T05:18:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to Perform Operations on a Column?</title>
      <link>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617397#M8674</link>
      <description>&lt;P&gt;As KSharp indicated, if you prefer working with vectorized operations, you can use PROC IML, which is included as part of SAS UE.&lt;/P&gt;
&lt;P&gt;Here are&amp;nbsp; &lt;A href="https://blogs.sas.com/content/iml/2014/08/11/ten-tips-for-learning-sasiml.html" target="_self"&gt;a few tips to get started learning the SAS/IML language.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2020 10:27:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/How-to-Perform-Operations-on-a-Column/m-p/617397#M8674</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-01-15T10:27:19Z</dc:date>
    </item>
  </channel>
</rss>

