289.Can Modern Art Data Explain What Actually Sells? – A Real-World SAS Analytics Project
Can Modern Art Data Explain What Actually Sells? – A Real-World SAS Analytics Project
1) Create the dataset with datalines
Purpose:Creaing the primary dataset modern_art with specified variables and formats.
options nocenter;
data work.modern_art;
infile datalines dlm='|' dsd truncover;
length ArtworkID $8 Title $60 Artist $40 Medium $20 Style $25 Gallery_City $30;
input ArtworkID $ Title :$60. Artist :$40. Year_Created Medium :$20. Style :$25.
Price_USD Gallery_City :$30.;
format Price_USD dollar12.2;
datalines;
A001|Chromatic Drift|Ananya Rao|2019|Acrylic on Canvas|Abstract Expressionism|12500|Mumbai
A002|Urban Echoes|Liam Patel|2021|Mixed Media|Street Modernism|8200|Bengaluru
A003|Silent Poles|Sofia Iyer|2018|Sculpture (Bronze)|Minimalist|22000|Hyderabad
A004|Neon Hymn|Arjun Mehra|2023|Digital Print|Neo-Pop|4500|Delhi
A005|Driftwood Sonata|Maya Kapoor|2017|Installation|Eco-Modernism|17800|Goa
A006|Voxel Garden|Ravi Shenoy|2020|3D-Printed Resin|Contemporary|9800|Chennai
A007|Palimpsest|Isha Menon|2015|Oil on Canvas|Abstract Expressionism|34000|Kolkata
A008|Glass Lattice|Omar Qureshi|2022|Glass Sculpture|Contemporary|15000|Pune
A009|Binary Bloom|Neha Sharma|2016|Interactive Media|Digital Avant-Garde|6400|Mumbai
A010|Folded Horizon|Karan Desai|2014|Paper Sculpture|Minimalist|5200|Ahmedabad
A011|Resonant Grid|Sara Reddy|2023|Acrylic & LED|Neo-Pop|11200|Hyderabad
A012|Salt Memory|Ritu Varma|2019|Mixed Media|Eco-Modernism|8600|Kochi
;
run;
proc print;run;
Output:
| Obs | ArtworkID | Title | Artist | Medium | Style | Gallery_City | Year_Created | Price_USD |
|---|---|---|---|---|---|---|---|---|
| 1 | A001 | Chromatic Drift | Ananya Rao | Acrylic on Canvas | Abstract Expressionism | Mumbai | 2019 | $12,500.00 |
| 2 | A002 | Urban Echoes | Liam Patel | Mixed Media | Street Modernism | Bengaluru | 2021 | $8,200.00 |
| 3 | A003 | Silent Poles | Sofia Iyer | Sculpture (Bronze) | Minimalist | Hyderabad | 2018 | $22,000.00 |
| 4 | A004 | Neon Hymn | Arjun Mehra | Digital Print | Neo-Pop | Delhi | 2023 | $4,500.00 |
| 5 | A005 | Driftwood Sonata | Maya Kapoor | Installation | Eco-Modernism | Goa | 2017 | $17,800.00 |
| 6 | A006 | Voxel Garden | Ravi Shenoy | 3D-Printed Resin | Contemporary | Chennai | 2020 | $9,800.00 |
| 7 | A007 | Palimpsest | Isha Menon | Oil on Canvas | Abstract Expressionism | Kolkata | 2015 | $34,000.00 |
| 8 | A008 | Glass Lattice | Omar Qureshi | Glass Sculpture | Contemporary | Pune | 2022 | $15,000.00 |
| 9 | A009 | Binary Bloom | Neha Sharma | Interactive Media | Digital Avant-Garde | Mumbai | 2016 | $6,400.00 |
| 10 | A010 | Folded Horizon | Karan Desai | Paper Sculpture | Minimalist | Ahmedabad | 2014 | $5,200.00 |
| 11 | A011 | Resonant Grid | Sara Reddy | Acrylic & LED | Neo-Pop | Hyderabad | 2023 | $11,200.00 |
| 12 | A012 | Salt Memory | Ritu Varma | Mixed Media | Eco-Modernism | Kochi | 2019 | $8,600.00 |
2) Quick print of the dataset
Purpose: PROC PRINT - quick tabular display for data inspection.
title "MODERN ART - RAW DATA (FIRST LOOK)";
proc print data=work.modern_art(obs=7) noobs label;
var ArtworkID Title Artist Year_Created Medium Style Price_USD Gallery_City;
run;
Output:
| ArtworkID | Title | Artist | Year_Created | Medium | Style | Price_USD | Gallery_City |
|---|---|---|---|---|---|---|---|
| A001 | Chromatic Drift | Ananya Rao | 2019 | Acrylic on Canvas | Abstract Expressioni | $12,500.00 | Mumbai |
| A002 | Urban Echoes | Liam Patel | 2021 | Mixed Media | Street Modernism | $8,200.00 | Bengaluru |
| A003 | Silent Poles | Sofia Iyer | 2018 | Sculpture (Bronze) | Minimalist | $22,000.00 | Hyderabad |
| A004 | Neon Hymn | Arjun Mehra | 2023 | Digital Print | Neo-Pop | $4,500.00 | Delhi |
| A005 | Driftwood Sonata | Maya Kapoor | 2017 | Installation | Eco-Modernism | $17,800.00 | Goa |
| A006 | Voxel Garden | Ravi Shenoy | 2020 | 3D-Printed Resin | Contemporary | $9,800.00 | Chennai |
| A007 | Palimpsest | Isha Menon | 2015 | Oil on Canvas | Abstract Expressioni | $34,000.00 | Kolkata |
3) Basic numeric summary on price
Purpose: PROC MEANS - summary statistics for continuous variable Price_USD.
proc means data=work.modern_art n mean median std min max maxdec=2;
var Price_USD;
title "PRICE SUMMARY (USD)";
run;
Output:
The MEANS Procedure
| Analysis Variable : Price_USD | |||||
|---|---|---|---|---|---|
| N | Mean | Median | Std Dev | Minimum | Maximum |
| 12 | 12933.33 | 10500.00 | 8430.28 | 4500.00 | 34000.00 |
4) Frequency distribution of Style and Medium
Purpose: PROC FREQ - count artworks by Style and Medium to see distribution.
proc freq data=work.modern_art order=freq;
tables Style Medium / nocum nopercent;
title "FREQUENCY: STYLE AND MEDIUM";
run;
Output:
The FREQ Procedure
| Style | Frequency |
|---|---|
| Abstract Expressioni | 2 |
| Contemporary | 2 |
| Eco-Modernism | 2 |
| Minimalist | 2 |
| Neo-Pop | 2 |
| Digital Avant-Garde | 1 |
| Street Modernism | 1 |
| Medium | Frequency |
|---|---|
| Mixed Media | 2 |
| 3D-Printed Resin | 1 |
| Acrylic & LED | 1 |
| Acrylic on Canvas | 1 |
| Digital Print | 1 |
| Glass Sculpture | 1 |
| Installation | 1 |
| Interactive Media | 1 |
| Oil on Canvas | 1 |
| Paper Sculpture | 1 |
| Sculpture (Bronze) | 1 |
5) Sort dataset by Style and descending Price
Purpose: PROC SORT - order data for grouped reporting.
proc sort data=work.modern_art out=work.modern_art_sorted;
by Style descending Price_USD;
run;
proc print;run;
Output:
| Obs | ArtworkID | Title | Artist | Medium | Style | Gallery_City | Year_Created | Price_USD |
|---|---|---|---|---|---|---|---|---|
| 1 | A007 | Palimpsest | Isha Menon | Oil on Canvas | Abstract Expressioni | Kolkata | 2015 | $34,000.00 |
| 2 | A001 | Chromatic Drift | Ananya Rao | Acrylic on Canvas | Abstract Expressioni | Mumbai | 2019 | $12,500.00 |
| 3 | A008 | Glass Lattice | Omar Qureshi | Glass Sculpture | Contemporary | Pune | 2022 | $15,000.00 |
| 4 | A006 | Voxel Garden | Ravi Shenoy | 3D-Printed Resin | Contemporary | Chennai | 2020 | $9,800.00 |
| 5 | A009 | Binary Bloom | Neha Sharma | Interactive Media | Digital Avant-Garde | Mumbai | 2016 | $6,400.00 |
| 6 | A005 | Driftwood Sonata | Maya Kapoor | Installation | Eco-Modernism | Goa | 2017 | $17,800.00 |
| 7 | A012 | Salt Memory | Ritu Varma | Mixed Media | Eco-Modernism | Kochi | 2019 | $8,600.00 |
| 8 | A003 | Silent Poles | Sofia Iyer | Sculpture (Bronze) | Minimalist | Hyderabad | 2018 | $22,000.00 |
| 9 | A010 | Folded Horizon | Karan Desai | Paper Sculpture | Minimalist | Ahmedabad | 2014 | $5,200.00 |
| 10 | A011 | Resonant Grid | Sara Reddy | Acrylic & LED | Neo-Pop | Hyderabad | 2023 | $11,200.00 |
| 11 | A004 | Neon Hymn | Arjun Mehra | Digital Print | Neo-Pop | Delhi | 2023 | $4,500.00 |
| 12 | A002 | Urban Echoes | Liam Patel | Mixed Media | Street Modernism | Bengaluru | 2021 | $8,200.00 |
6) Use PROC REPORT for a professional grouped table
Purpose: PROC REPORT - formatted grouped report showing artworks by Style and Gallery.
proc report data=work.modern_art_sorted nowd headline headskip;
column Style Gallery_City Artist Title Year_Created Price_USD;
define Style / group 'Style';
define Gallery_City / group 'Gallery City';
define Artist / display 'Artist';
define Title / display 'Title';
define Year_Created / analysis 'Year';
define Price_USD / analysis sum format=dollar12.2 'Price (USD)';
title "GROUPED REPORT: ARTWORKS BY STYLE & GALLERY";
run;
Output:
| Style | Gallery City | Artist | Title | Year | Price (USD) |
|---|---|---|---|---|---|
| Abstract Expressioni | Kolkata | Isha Menon | Palimpsest | 2015 | $34,000.00 |
| Mumbai | Ananya Rao | Chromatic Drift | 2019 | $12,500.00 | |
| Contemporary | Chennai | Ravi Shenoy | Voxel Garden | 2020 | $9,800.00 |
| Pune | Omar Qureshi | Glass Lattice | 2022 | $15,000.00 | |
| Digital Avant-Garde | Mumbai | Neha Sharma | Binary Bloom | 2016 | $6,400.00 |
| Eco-Modernism | Goa | Maya Kapoor | Driftwood Sonata | 2017 | $17,800.00 |
| Kochi | Ritu Varma | Salt Memory | 2019 | $8,600.00 | |
| Minimalist | Ahmedabad | Karan Desai | Folded Horizon | 2014 | $5,200.00 |
| Hyderabad | Sofia Iyer | Silent Poles | 2018 | $22,000.00 | |
| Neo-Pop | Delhi | Arjun Mehra | Neon Hymn | 2023 | $4,500.00 |
| Hyderabad | Sara Reddy | Resonant Grid | 2023 | $11,200.00 | |
| Street Modernism | Bengaluru | Liam Patel | Urban Echoes | 2021 | $8,200.00 |
7) PROC SQL: create a summary table with counts and average price per style
Purpose: PROC SQL - produce summary aggregations by Style.
proc sql;
create table work.style_summary as
select Style,
count(*) as N_Artworks,
mean(Price_USD) as Avg_Price format=dollar12.2,
min(Price_USD) as Min_Price format=dollar12.2,
max(Price_USD) as Max_Price format=dollar12.2
from work.modern_art
group by Style
order by N_Artworks desc;
quit;
proc print;run;
Output:
| Obs | Style | N_Artworks | Avg_Price | Min_Price | Max_Price |
|---|---|---|---|---|---|
| 1 | Neo-Pop | 2 | $7,850.00 | $4,500.00 | $11,200.00 |
| 2 | Minimalist | 2 | $13,600.00 | $5,200.00 | $22,000.00 |
| 3 | Abstract Expressioni | 2 | $23,250.00 | $12,500.00 | $34,000.00 |
| 4 | Contemporary | 2 | $12,400.00 | $9,800.00 | $15,000.00 |
| 5 | Eco-Modernism | 2 | $13,200.00 | $8,600.00 | $17,800.00 |
| 6 | Digital Avant-Garde | 1 | $6,400.00 | $6,400.00 | $6,400.00 |
| 7 | Street Modernism | 1 | $8,200.00 | $8,200.00 | $8,200.00 |
8) Macro to create price band reports across the whole dataset
Purpose: %price_band_report - bucket artworks into price bands and show counts per band.
%macro price_band_report(lb=, ub=);
%local dsname;
%let dsname = priceband_&lb._to_&ub;
proc sql;
create table work.&dsname as
select *, case
when Price_USD < &lb then "<&lb"
when Price_USD between &lb and &ub then "&lb-&ub"
else ">&ub"
end as Price_Band
from work.modern_art;
quit;
proc print;run;
title "PRICE BAND REPORT: &lb to &ub";
proc freq data=work.&dsname;
tables Price_Band / nocum;
run;
%mend price_band_report;
%price_band_report(lb=0, ub=8000);
Output:
| Obs | ArtworkID | Title | Artist | Medium | Style | Gallery_City | Year_Created | Price_USD | Price_Band |
|---|---|---|---|---|---|---|---|---|---|
| 1 | A001 | Chromatic Drift | Ananya Rao | Acrylic on Canvas | Abstract Expressionism | Mumbai | 2019 | $12,500.00 | >8000 |
| 2 | A002 | Urban Echoes | Liam Patel | Mixed Media | Street Modernism | Bengaluru | 2021 | $8,200.00 | >8000 |
| 3 | A003 | Silent Poles | Sofia Iyer | Sculpture (Bronze) | Minimalist | Hyderabad | 2018 | $22,000.00 | >8000 |
| 4 | A004 | Neon Hymn | Arjun Mehra | Digital Print | Neo-Pop | Delhi | 2023 | $4,500.00 | 0-8000 |
| 5 | A005 | Driftwood Sonata | Maya Kapoor | Installation | Eco-Modernism | Goa | 2017 | $17,800.00 | >8000 |
| 6 | A006 | Voxel Garden | Ravi Shenoy | 3D-Printed Resin | Contemporary | Chennai | 2020 | $9,800.00 | >8000 |
| 7 | A007 | Palimpsest | Isha Menon | Oil on Canvas | Abstract Expressionism | Kolkata | 2015 | $34,000.00 | >8000 |
| 8 | A008 | Glass Lattice | Omar Qureshi | Glass Sculpture | Contemporary | Pune | 2022 | $15,000.00 | >8000 |
| 9 | A009 | Binary Bloom | Neha Sharma | Interactive Media | Digital Avant-Garde | Mumbai | 2016 | $6,400.00 | 0-8000 |
| 10 | A010 | Folded Horizon | Karan Desai | Paper Sculpture | Minimalist | Ahmedabad | 2014 | $5,200.00 | 0-8000 |
| 11 | A011 | Resonant Grid | Sara Reddy | Acrylic & LED | Neo-Pop | Hyderabad | 2023 | $11,200.00 | >8000 |
| 12 | A012 | Salt Memory | Ritu Varma | Mixed Media | Eco-Modernism | Kochi | 2019 | $8,600.00 | >8000 |
The FREQ Procedure
| Price_Band | Frequency | Percent |
|---|---|---|
| 0-8000 | 3 | 25.00 |
| >8000 | 9 | 75.00 |
%price_band_report(lb=8001, ub=20000);
Output:
| Obs | ArtworkID | Title | Artist | Medium | Style | Gallery_City | Year_Created | Price_USD | Price_Band |
|---|---|---|---|---|---|---|---|---|---|
| 1 | A001 | Chromatic Drift | Ananya Rao | Acrylic on Canvas | Abstract Expressionism | Mumbai | 2019 | $12,500.00 | 8001-20000 |
| 2 | A002 | Urban Echoes | Liam Patel | Mixed Media | Street Modernism | Bengaluru | 2021 | $8,200.00 | 8001-20000 |
| 3 | A003 | Silent Poles | Sofia Iyer | Sculpture (Bronze) | Minimalist | Hyderabad | 2018 | $22,000.00 | >20000 |
| 4 | A004 | Neon Hymn | Arjun Mehra | Digital Print | Neo-Pop | Delhi | 2023 | $4,500.00 | <8001 |
| 5 | A005 | Driftwood Sonata | Maya Kapoor | Installation | Eco-Modernism | Goa | 2017 | $17,800.00 | 8001-20000 |
| 6 | A006 | Voxel Garden | Ravi Shenoy | 3D-Printed Resin | Contemporary | Chennai | 2020 | $9,800.00 | 8001-20000 |
| 7 | A007 | Palimpsest | Isha Menon | Oil on Canvas | Abstract Expressionism | Kolkata | 2015 | $34,000.00 | >20000 |
| 8 | A008 | Glass Lattice | Omar Qureshi | Glass Sculpture | Contemporary | Pune | 2022 | $15,000.00 | 8001-20000 |
| 9 | A009 | Binary Bloom | Neha Sharma | Interactive Media | Digital Avant-Garde | Mumbai | 2016 | $6,400.00 | <8001 |
| 10 | A010 | Folded Horizon | Karan Desai | Paper Sculpture | Minimalist | Ahmedabad | 2014 | $5,200.00 | <8001 |
| 11 | A011 | Resonant Grid | Sara Reddy | Acrylic & LED | Neo-Pop | Hyderabad | 2023 | $11,200.00 | 8001-20000 |
| 12 | A012 | Salt Memory | Ritu Varma | Mixed Media | Eco-Modernism | Kochi | 2019 | $8,600.00 | 8001-20000 |
The FREQ Procedure
| Price_Band | Frequency | Percent |
|---|---|---|
| 8001-20000 | 7 | 58.33 |
| <8001 | 3 | 25.00 |
| >20000 | 2 | 16.67 |
9) Simple QC: check for missing critical variables
Purpose: DATA/QC + PROC FREQ - find records with missing critical values.
data work.qc_checks;
set work.modern_art;
missing_flag = (missing(ArtworkID) or missing(Title) or missing(Artist) or missing(Price_USD));
run;
proc print;run;
Output:
| Obs | ArtworkID | Title | Artist | Medium | Style | Gallery_City | Year_Created | Price_USD | missing_flag |
|---|---|---|---|---|---|---|---|---|---|
| 1 | A001 | Chromatic Drift | Ananya Rao | Acrylic on Canvas | Abstract Expressionism | Mumbai | 2019 | $12,500.00 | 0 |
| 2 | A002 | Urban Echoes | Liam Patel | Mixed Media | Street Modernism | Bengaluru | 2021 | $8,200.00 | 0 |
| 3 | A003 | Silent Poles | Sofia Iyer | Sculpture (Bronze) | Minimalist | Hyderabad | 2018 | $22,000.00 | 0 |
| 4 | A004 | Neon Hymn | Arjun Mehra | Digital Print | Neo-Pop | Delhi | 2023 | $4,500.00 | 0 |
| 5 | A005 | Driftwood Sonata | Maya Kapoor | Installation | Eco-Modernism | Goa | 2017 | $17,800.00 | 0 |
| 6 | A006 | Voxel Garden | Ravi Shenoy | 3D-Printed Resin | Contemporary | Chennai | 2020 | $9,800.00 | 0 |
| 7 | A007 | Palimpsest | Isha Menon | Oil on Canvas | Abstract Expressionism | Kolkata | 2015 | $34,000.00 | 0 |
| 8 | A008 | Glass Lattice | Omar Qureshi | Glass Sculpture | Contemporary | Pune | 2022 | $15,000.00 | 0 |
| 9 | A009 | Binary Bloom | Neha Sharma | Interactive Media | Digital Avant-Garde | Mumbai | 2016 | $6,400.00 | 0 |
| 10 | A010 | Folded Horizon | Karan Desai | Paper Sculpture | Minimalist | Ahmedabad | 2014 | $5,200.00 | 0 |
| 11 | A011 | Resonant Grid | Sara Reddy | Acrylic & LED | Neo-Pop | Hyderabad | 2023 | $11,200.00 | 0 |
| 12 | A012 | Salt Memory | Ritu Varma | Mixed Media | Eco-Modernism | Kochi | 2019 | $8,600.00 | 0 |
proc freq data=work.qc_checks;
tables missing_flag / nocum;
title "QC: MISSING CRITICAL FIELDS";
run;
Output:
The FREQ Procedure
| missing_flag | Frequency | Percent |
|---|---|---|
| 0 | 12 | 100.00 |
Comments
Post a Comment