Sunday, 28 December 2025

353.ROBOTICS INNOVATIONS DATA ANALYSIS USING SAS DATA STEP | PROC SQL | PROC MEANS | PROC FREQ | PROC RANK | MACROS | DATE FUNCTIONS (MDY - INTNX - INTCK) | APPEND | MERGE | TRANSPOSE

ROBOTICS INNOVATIONS DATA ANALYSIS USING SAS DATA STEP | PROC SQL | PROC MEANS |  PROC FREQ | PROC RANK | MACROS | DATE FUNCTIONS (MDY - INTNX - INTCK) | APPEND | MERGE | TRANSPOSE

options nocenter;

1.ROBOTICS BASE DATASET CREATION

data robotics_base;

    length Robot_Name $20 Usage $20 Country $15 Complexity_Level $10;

    format Launch_Date Review_Date date9.;

    input Robot_Name $ Usage $ Country $ Cost Complexity_Level $ Adoption_Rate 

          Launch_Date :date9.;

    Review_Date = intnx('month', Launch_Date, 6, 'same');

    datalines;

RoboMedic Healthcare USA 250000 High 72 15JAN2020

AutoArm Manufacturing Germany 180000 Medium 65 10MAR2019

AgriBot Agriculture India 90000 Medium 58 22JUL2021

SentinelX Defense Israel 400000 High 80 01DEC2018

CleanMate Domestic Japan 45000 Low 74 05FEB2022

LogiBot Logistics China 120000 Medium 69 19SEP2020

EduDroid Education UK 60000 Low 55 12APR2021

RescueOne Disaster USA 300000 High 62 03AUG2019

NanoSurgeon Healthcare Switzerland 500000 High 48 28NOV2017

MineRover Mining Australia 220000 Medium 51 14MAY2018

HotelBot Service Singapore 75000 Low 66 20JAN2022

FarmAssist Agriculture Netherlands 110000 Medium 59 18JUN2020

DefenseAI Defense SouthKorea 420000 High 77 11OCT2019

;

run;

proc print data=robotics_base;

run;

OUTPUT:

ObsRobot_NameUsageCountryComplexity_LevelLaunch_DateReview_DateCostAdoption_Rate
1RoboMedicHealthcareUSAHigh15JAN202015JUL202025000072
2AutoArmManufacturingGermanyMedium10MAR201910SEP201918000065
3AgriBotAgricultureIndiaMedium22JUL202122JAN20229000058
4SentinelXDefenseIsraelHigh01DEC201801JUN201940000080
5CleanMateDomesticJapanLow05FEB202205AUG20224500074
6LogiBotLogisticsChinaMedium19SEP202019MAR202112000069
7EduDroidEducationUKLow12APR202112OCT20216000055
8RescueOneDisasterUSAHigh03AUG201903FEB202030000062
9NanoSurgeonHealthcareSwitzerlandHigh28NOV201728MAY201850000048
10MineRoverMiningAustraliaMedium14MAY201814NOV201822000051
11HotelBotServiceSingaporeLow20JAN202220JUL20227500066
12FarmAssistAgricultureNetherlandsMedium18JUN202018DEC202011000059
13DefenseAIDefenseSouthKoreaHigh11OCT201911APR202042000077


2.DATE FUNCTIONS PRACTICE (MDY | INTNX | INTCK)

data robotics_dates;

    set robotics_base;

    Year_Launched = year(Launch_Date);

    Months_Since_Launch = intck('month', Launch_Date, today());

    Next_Review = intnx('year', Launch_Date, 1, 'same');

    Custom_Date = mdy(12,31,Year_Launched);

    format Next_Review Custom_Date date9.;

run;

proc print data=robotics_dates;

run;

OUTPUT:

ObsRobot_NameUsageCountryComplexity_LevelLaunch_DateReview_DateCostAdoption_RateYear_LaunchedMonths_Since_LaunchNext_ReviewCustom_Date
1RoboMedicHealthcareUSAHigh15JAN202015JUL20202500007220207115JAN202131DEC2020
2AutoArmManufacturingGermanyMedium10MAR201910SEP20191800006520198110MAR202031DEC2019
3AgriBotAgricultureIndiaMedium22JUL202122JAN2022900005820215322JUL202231DEC2021
4SentinelXDefenseIsraelHigh01DEC201801JUN20194000008020188401DEC201931DEC2018
5CleanMateDomesticJapanLow05FEB202205AUG2022450007420224605FEB202331DEC2022
6LogiBotLogisticsChinaMedium19SEP202019MAR20211200006920206319SEP202131DEC2020
7EduDroidEducationUKLow12APR202112OCT2021600005520215612APR202231DEC2021
8RescueOneDisasterUSAHigh03AUG201903FEB20203000006220197603AUG202031DEC2019
9NanoSurgeonHealthcareSwitzerlandHigh28NOV201728MAY20185000004820179728NOV201831DEC2017
10MineRoverMiningAustraliaMedium14MAY201814NOV20182200005120189114MAY201931DEC2018
11HotelBotServiceSingaporeLow20JAN202220JUL2022750006620224720JAN202331DEC2022
12FarmAssistAgricultureNetherlandsMedium18JUN202018DEC20201100005920206618JUN202131DEC2020
13DefenseAIDefenseSouthKoreaHigh11OCT201911APR20204200007720197411OCT202031DEC2019


3.PROC SQL – DATA EXTRACTION & DERIVATIONS

proc sql;

    create table robotics_sql as

    select Robot_Name,Usage,Country,Cost,Complexity_Level,Adoption_Rate,Launch_Date,

           Review_Date,

           case 

             when Cost > 300000 then 'Very Expensive'

             when Cost > 150000 then 'Expensive'

             else 'Affordable'

           end as Cost_Category

    from robotics_dates;

quit;

proc print data=robotics_sql;

run;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_Category
1RoboMedicHealthcareUSA250000High7215JAN202015JUL2020Expensive
2AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019Expensive
3AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022Affordable
4SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very Expensive
5CleanMateDomesticJapan45000Low7405FEB202205AUG2022Affordable
6LogiBotLogisticsChina120000Medium6919SEP202019MAR2021Affordable
7EduDroidEducationUK60000Low5512APR202112OCT2021Affordable
8RescueOneDisasterUSA300000High6203AUG201903FEB2020Expensive
9NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very Expensive
10MineRoverMiningAustralia220000Medium5114MAY201814NOV2018Expensive
11HotelBotServiceSingapore75000Low6620JAN202220JUL2022Affordable
12FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020Affordable
13DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very Expensive


4.PROC MEANS – NUMERICAL SUMMARY

proc means data=robotics_sql mean min max;

    var Cost Adoption_Rate;

run;

OUTPUT:

The MEANS Procedure

VariableMeanMinimumMaximum
Cost
Adoption_Rate
213076.92
64.3076923
45000.00
48.0000000
500000.00
80.0000000

5.PROC FREQ – CATEGORICAL ANALYSIS

proc freq data=robotics_sql;

    tables Country*Complexity_Level / nocum;

run;

OUTPUT:

The FREQ Procedure

Frequency
Percent
Row Pct
Col Pct
Table of Country by Complexity_Level
CountryComplexity_Level
HighLowMediumTotal
Australia
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
100.00
20.00
1
7.69
 
 
China
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
100.00
20.00
1
7.69
 
 
Germany
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
100.00
20.00
1
7.69
 
 
India
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
100.00
20.00
1
7.69
 
 
Israel
1
7.69
100.00
20.00
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
 
 
Japan
0
0.00
0.00
0.00
1
7.69
100.00
33.33
0
0.00
0.00
0.00
1
7.69
 
 
Netherlands
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
100.00
20.00
1
7.69
 
 
Singapore
0
0.00
0.00
0.00
1
7.69
100.00
33.33
0
0.00
0.00
0.00
1
7.69
 
 
SouthKorea
1
7.69
100.00
20.00
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
 
 
Switzerland
1
7.69
100.00
20.00
0
0.00
0.00
0.00
0
0.00
0.00
0.00
1
7.69
 
 
UK
0
0.00
0.00
0.00
1
7.69
100.00
33.33
0
0.00
0.00
0.00
1
7.69
 
 
USA
2
15.38
100.00
40.00
0
0.00
0.00
0.00
0
0.00
0.00
0.00
2
15.38
 
 
Total
5
38.46
3
23.08
5
38.46
13
100.00

6.MACRO – AUTOMATION LEVEL CLASSIFICATION

%macro automation_level;

data robotics_auto;

    set robotics_sql;

    length Automation_Level $30;

    if Adoption_Rate >= 70 then Automation_Level='Highly Automated';

    else if Adoption_Rate >= 55 then Automation_Level='Moderately Automated';

    else Automation_Level='Low Automation';

run;

proc print data=robotics_auto;

run;

%mend;


%automation_level;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_CategoryAutomation_Level
1RoboMedicHealthcareUSA250000High7215JAN202015JUL2020ExpensiveHighly Automated
2AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019ExpensiveModerately Automated
3AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022AffordableModerately Automated
4SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very ExpensiveHighly Automated
5CleanMateDomesticJapan45000Low7405FEB202205AUG2022AffordableHighly Automated
6LogiBotLogisticsChina120000Medium6919SEP202019MAR2021AffordableModerately Automated
7EduDroidEducationUK60000Low5512APR202112OCT2021AffordableModerately Automated
8RescueOneDisasterUSA300000High6203AUG201903FEB2020ExpensiveModerately Automated
9NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very ExpensiveLow Automation
10MineRoverMiningAustralia220000Medium5114MAY201814NOV2018ExpensiveLow Automation
11HotelBotServiceSingapore75000Low6620JAN202220JUL2022AffordableModerately Automated
12FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020AffordableModerately Automated
13DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very ExpensiveHighly Automated


7.PROC RANK – ROBOT ADOPTION RANKING

proc rank data=robotics_auto out=robotics_rank descending;

    var Adoption_Rate;

    ranks Adoption_Rank;

run;

proc print data=robotics_rank;

run;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_CategoryAutomation_LevelAdoption_Rank
1RoboMedicHealthcareUSA250000High7215JAN202015JUL2020ExpensiveHighly Automated4
2AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019ExpensiveModerately Automated7
3AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022AffordableModerately Automated10
4SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very ExpensiveHighly Automated1
5CleanMateDomesticJapan45000Low7405FEB202205AUG2022AffordableHighly Automated3
6LogiBotLogisticsChina120000Medium6919SEP202019MAR2021AffordableModerately Automated5
7EduDroidEducationUK60000Low5512APR202112OCT2021AffordableModerately Automated11
8RescueOneDisasterUSA300000High6203AUG201903FEB2020ExpensiveModerately Automated8
9NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very ExpensiveLow Automation13
10MineRoverMiningAustralia220000Medium5114MAY201814NOV2018ExpensiveLow Automation12
11HotelBotServiceSingapore75000Low6620JAN202220JUL2022AffordableModerately Automated6
12FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020AffordableModerately Automated9
13DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very ExpensiveHighly Automated2


8.PROC APPEND – ADDITIONAL ROBOT RECORDS

data robotics_new;

    length Robot_Name $20 Usage $20 Country $15 Complexity_Level $10;

    input Robot_Name $ Usage $ Country $ Cost Complexity_Level $ Adoption_Rate Launch_Date :date9.;

    datalines;

SmartGuard Security USA 280000 High 71 02FEB2021

;

run;

proc print data=robotics_new;

run;

OUTPUT:

ObsRobot_NameUsageCountryComplexity_LevelCostAdoption_RateLaunch_Date
1SmartGuardSecurityUSAHigh2800007122313

proc append base=robotics_rank 

            data=robotics_new force;

run;

proc print data=robotics_rank;

run;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_CategoryAutomation_LevelAdoption_Rank
1RoboMedicHealthcareUSA250000High7215JAN202015JUL2020ExpensiveHighly Automated4
2AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019ExpensiveModerately Automated7
3AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022AffordableModerately Automated10
4SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very ExpensiveHighly Automated1
5CleanMateDomesticJapan45000Low7405FEB202205AUG2022AffordableHighly Automated3
6LogiBotLogisticsChina120000Medium6919SEP202019MAR2021AffordableModerately Automated5
7EduDroidEducationUK60000Low5512APR202112OCT2021AffordableModerately Automated11
8RescueOneDisasterUSA300000High6203AUG201903FEB2020ExpensiveModerately Automated8
9NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very ExpensiveLow Automation13
10MineRoverMiningAustralia220000Medium5114MAY201814NOV2018ExpensiveLow Automation12
11HotelBotServiceSingapore75000Low6620JAN202220JUL2022AffordableModerately Automated6
12FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020AffordableModerately Automated9
13DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very ExpensiveHighly Automated2
14SmartGuardSecurityUSA280000High7102FEB2021.  .


9.PROC MERGE – COUNTRY METADATA JOIN

data country_info;

    length Country $15 Region $15;

    input Country $ Region $;

    datalines;

USA NorthAmerica

Germany Europe

India Asia

Japan Asia

China Asia

;

run;

proc print data=country_info;

run;

OUTPUT:

ObsCountryRegion
1USANorthAmerica
2GermanyEurope
3IndiaAsia
4JapanAsia
5ChinaAsia

proc sort data=robotics_rank; by Country; run;

proc print data=robotics_rank;

run;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_CategoryAutomation_LevelAdoption_Rank
1MineRoverMiningAustralia220000Medium5114MAY201814NOV2018ExpensiveLow Automation12
2LogiBotLogisticsChina120000Medium6919SEP202019MAR2021AffordableModerately Automated5
3AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019ExpensiveModerately Automated7
4AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022AffordableModerately Automated10
5SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very ExpensiveHighly Automated1
6CleanMateDomesticJapan45000Low7405FEB202205AUG2022AffordableHighly Automated3
7FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020AffordableModerately Automated9
8HotelBotServiceSingapore75000Low6620JAN202220JUL2022AffordableModerately Automated6
9DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very ExpensiveHighly Automated2
10NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very ExpensiveLow Automation13
11EduDroidEducationUK60000Low5512APR202112OCT2021AffordableModerately Automated11
12RoboMedicHealthcareUSA250000High7215JAN202015JUL2020ExpensiveHighly Automated4
13RescueOneDisasterUSA300000High6203AUG201903FEB2020ExpensiveModerately Automated8
14SmartGuardSecurityUSA280000High7102FEB2021.  .

proc sort data=country_info; by Country; run;

proc print data=robotics_info;

run;

OUTPUT:

ObsCountryRegion
1ChinaAsia
2GermanyEurope
3IndiaAsia
4JapanAsia
5USANorthAmerica

data robotics_merged;

    merge robotics_rank(in=a) country_info(in=b);

    by Country;

    if a;

run;

proc print data=robotics_merged;

run;

OUTPUT:

ObsRobot_NameUsageCountryCostComplexity_LevelAdoption_RateLaunch_DateReview_DateCost_CategoryAutomation_LevelAdoption_RankRegion
1MineRoverMiningAustralia220000Medium5114MAY201814NOV2018ExpensiveLow Automation12 
2LogiBotLogisticsChina120000Medium6919SEP202019MAR2021AffordableModerately Automated5Asia
3AutoArmManufacturingGermany180000Medium6510MAR201910SEP2019ExpensiveModerately Automated7Europe
4AgriBotAgricultureIndia90000Medium5822JUL202122JAN2022AffordableModerately Automated10Asia
5SentinelXDefenseIsrael400000High8001DEC201801JUN2019Very ExpensiveHighly Automated1 
6CleanMateDomesticJapan45000Low7405FEB202205AUG2022AffordableHighly Automated3Asia
7FarmAssistAgricultureNetherlands110000Medium5918JUN202018DEC2020AffordableModerately Automated9 
8HotelBotServiceSingapore75000Low6620JAN202220JUL2022AffordableModerately Automated6 
9DefenseAIDefenseSouthKorea420000High7711OCT201911APR2020Very ExpensiveHighly Automated2 
10NanoSurgeonHealthcareSwitzerland500000High4828NOV201728MAY2018Very ExpensiveLow Automation13 
11EduDroidEducationUK60000Low5512APR202112OCT2021AffordableModerately Automated11 
12RoboMedicHealthcareUSA250000High7215JAN202015JUL2020ExpensiveHighly Automated4NorthAmerica
13RescueOneDisasterUSA300000High6203AUG201903FEB2020ExpensiveModerately Automated8NorthAmerica
14SmartGuardSecurityUSA280000High7102FEB2021.  .NorthAmerica


10.PROC TRANSPOSE – ADOPTION RATE VIEW

proc transpose data=robotics_merged out=robotics_transpose prefix=Robot_;

    by Country;

    var Adoption_Rate;

run;

proc print data=robotics_transpose;

run;

OUTPUT:

ObsCountry_NAME_Robot_1Robot_2Robot_3
1AustraliaAdoption_Rate51..
2ChinaAdoption_Rate69..
3GermanyAdoption_Rate65..
4IndiaAdoption_Rate58..
5IsraelAdoption_Rate80..
6JapanAdoption_Rate74..
7NetherlandsAdoption_Rate59..
8SingaporeAdoption_Rate66..
9SouthKoreaAdoption_Rate77..
10SwitzerlandAdoption_Rate48..
11UKAdoption_Rate55..
12USAAdoption_Rate726271


YESTERDAY'S QUESTION:

12.PROC MEANS

proc means data=safari_zones;

    var Animals_Count Tourists Revenue;

    group by Zone_Name;

run;

**GROUP BY is not supported in PROC MEANS

proc means data=safari_zones;

    var Animals_Count Tourists Revenue;

    class Zone_Name;

run;

**CLASS is  supported in PROC MEANS

/* Note: In practice above there is an Invalid in this code Find it,Correct it and Use it /*

OUTPUT:

The MEANS Procedure

Zone_NameN ObsVariableNMeanStd DevMinimumMaximum
Bandipur1
Animals_Count
Tourists
Revenue
1
1
1
1100.00
410000.00
78.0000000
.
.
.
1100.00
410000.00
78.0000000
1100.00
410000.00
78.0000000
GirForest1
Animals_Count
Tourists
Revenue
1
1
1
900.0000000
380000.00
70.0000000
.
.
.
900.0000000
380000.00
70.0000000
900.0000000
380000.00
70.0000000
JimCorbett1
Animals_Count
Tourists
Revenue
1
1
1
1500.00
520000.00
95.0000000
.
.
.
1500.00
520000.00
95.0000000
1500.00
520000.00
95.0000000
Kaziranga1
Animals_Count
Tourists
Revenue
1
1
1
1800.00
610000.00
110.0000000
.
.
.
1800.00
610000.00
110.0000000
1800.00
610000.00
110.0000000
Manas1
Animals_Count
Tourists
Revenue
1
1
1
1350.00
330000.00
68.0000000
.
.
.
1350.00
330000.00
68.0000000
1350.00
330000.00
68.0000000
Nagarhole1
Animals_Count
Tourists
Revenue
1
1
1
1150.00
360000.00
74.0000000
.
.
.
1150.00
360000.00
74.0000000
1150.00
360000.00
74.0000000
Pench1
Animals_Count
Tourists
Revenue
1
1
1
980.0000000
310000.00
65.0000000
.
.
.
980.0000000
310000.00
65.0000000
980.0000000
310000.00
65.0000000
Periyar1
Animals_Count
Tourists
Revenue
1
1
1
950.0000000
290000.00
60.0000000
.
.
.
950.0000000
290000.00
60.0000000
950.0000000
290000.00
60.0000000
Ranthambore1
Animals_Count
Tourists
Revenue
1
1
1
1200.00
450000.00
85.0000000
.
.
.
1200.00
450000.00
85.0000000
1200.00
450000.00
85.0000000
Satpura1
Animals_Count
Tourists
Revenue
1
1
1
1050.00
270000.00
55.0000000
.
.
.
1050.00
270000.00
55.0000000
1050.00
270000.00
55.0000000
Sundarbans1
Animals_Count
Tourists
Revenue
1
1
1
1600.00
470000.00
105.0000000
.
.
.
1600.00
470000.00
105.0000000
1600.00
470000.00
105.0000000
Tadoba1
Animals_Count
Tourists
Revenue
1
1
1
1250.00
340000.00
72.0000000
.
.
.
1250.00
340000.00
72.0000000
1250.00
340000.00
72.0000000
Valmiki1
Animals_Count
Tourists
Revenue
1
1
1
850.0000000
220000.00
48.0000000
.
.
.
850.0000000
220000.00
48.0000000
850.0000000
220000.00
48.0000000





To Visit My Previous Software Company Analysis Dataset:Click Here
To Visit My Previous Vote Program Dataset:Click Here
To Visit My Previous Audi Cars Performance Analysis Dataset:Click Here
To Visit My Previous Global Clothing Trends Dataset:Click Here  



Follow Us On : 


 


---> FOLLOW OUR BLOG FOR MORE INFORMATION.

--->PLEASE DO COMMENTS AND SHARE OUR BLOG.

No comments:

Post a Comment