DatagSciencegLabgManualggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggg
CONTENTS
1. Syllabus
2. CoursegObjectives
3. CoursegOutcomes
4. EquipmentgRequired
5. ListgofgExercises
5.1
5.2
5.3
5.4
6. CodegofgConduct
1. SYLLABUS
1. RgASgCALCULATORgAPPLICATIONga.gUsinggwith
gandgwithoutgRgobjectsgongconsolegb.gUsinggmathematicalgfunctionsgongconsolegc.gWritegangRgscript,gtogcreategR
gobjectsgforgcalculatorgapplicationgandgsavegingagspecifiedglocationgingdisk
,ggMCAgIIgYearg–gIgSem
DatagSciencegLabgManualggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggg
2. gDESCRIPTIVEgSTATISTICSgINgRga.gWritegangRgsc
riptgtogfindgbasicgdescriptivegstatisticsgusinggsummary,gstr,gquartilegfunctiongongmtcars&gcarsgdatasets.gb.gWriteg
angRgscriptgtogfindgsubsetgofgdatasetgbygusinggsubsetg(),gaggregateg()gfunctionsgongirisgdataset.
3. gREADINGgANDgWRITINGgDIFFERENTgTYPESgO
FgDATASETSga.gReadinggdifferentgtypesgofgdatagsetsg(.txt,g.csv)gfromgWebgandgdiskgandgwritinggingfilegingspeci
ficgdiskglocation.gb.gReadinggExcelgdatagsheetgingR.gc.gReadinggXMLgdatasetgingR.g
4. gVISUALIZATIONSga.gFindgthegdatagdistributionsgusi
nggboxgandgscattergplot.gb.gFindgthegoutliersgusinggplot.gc.gPlotgtheghistogram,gbargchartgandgpiegchartgongsample
gdata.
5. CORRELATIONgANDgCOVARIANCEga.gFindgthegc
orrelationgmatrix.gb.gPlotgthegcorrelationgplotgongdatasetgandgvisualizeggivinggangoverviewgofgrelationshipsgamon
ggdatagongirisgdata.gc.gAnalysisgofgcovariance:gvarianceg(ANOVA),gifgdataghavegcategoricalgvariablesgongirisgdat
a.
6. gREGRESSIONgMODELgImportgagdatagfromgwebgsto
rage.gNamegthegdatasetgandgnowgdogLogisticgRegressiongtogfindgoutgrelationgbetweengvariablesgthatgaregaffecting
gthegadmissiongofgagstudentgingaginstitutegbasedgonghisgorghergGREgscore,gGPAgobtainedgandg32grankgofgthegstud
ent.gAlsogcheckgthegmodelgisgfitgorgnot.gRequireg(foreign),grequireg(MASS).g
7. gMULTIPLEgREGRESSION gMODELgApplygmultiple
gregressions,gifgdataghavegagcontinuousgIndependentgvariable.gApplygongabovegdataset.g
8. REGRESSIONgMODELgFORgPREDICTIONgApplygr
egressiongModelgtechniquesgtogpredictgthegdatagongabovegdataset.g
9. CLASSIFICATIONgMODELga.gInstallgrelevantgpacka
gegforgclassification.gb.gChoosegclassifiergforgclassificationgproblem.gc.gEvaluategthegperformancegofgclassifier.g
10. gCLUSTERINGgMODELga.gClusteringgalgorithmsgfor
gunsupervisedgclassification.gb.gPlotgthegclustergdatagusinggRgvisualizations.
2.gggCOURSEgOBJECTIVES
1.gLearngRgprogramminggbasicsg
2.gStudygdescriptivegstatistics
g3.gUnderstandgreadinggandgwritinggdatasetsg
4.gLearngcorrelation,gcovariancegandgregressiongmodel
5.gComprehendgmultiplegregressiongmodelgandgitsgusegforgprediction
3.ggCOURSEgOUTCOMES
1.gExecutegRgprogramminggbasicsg
2.gImplementgdescriptivegstatisticsg
3.gExecutegreadinggandgwritinggdatasetsg
4.gImplementgcorrelation,gcovariancegandgregressiongmodelg
5.gExecutegmultiplegregressiongmodelgandgitsgusegforgprediction
4.ggggEQUIPMENTgREQUIRED
g
Hardware
No.gofgSystemgggggggggggggggggggggggg :ggggggggggg60(IBM)
Processorgggggggggggggggggggggggggggggggggggg :gggggggggggPIV™g1.67gGHz
RAMgggggggggggggggggggggggggggggggggggggggggggg g:ggggggggggg512gMB
HardgDiskggggggggggggggggggggggggggggggg g:ggggggggggg40gGB
Mouseggggggggggggggggggggggggggggggggggggg g:gggggggggggOpticalgMouse
NetworkgInterfacegcardggggggggg g:gggggggggggPresent
Software
OperatinggSystemggggggggggggggg g:gggggggggggWindowgXP
Softwaregggggggggggg g:gggggggggggRgStudiog
,ggMCAgIIgYearg–gIgSem
DatagSciencegLabgManualggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggg
, ggMCAgIIgYearg–gIgSem
DatagSciencegLabgManualggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
ggggggggggggggggggg
5.ggggListgofgExcercies
1.gDownloading,ginstallinggandgsettinggpathgforgR.gg
2.gGivegangideagofgRgDatagTypes.gg
3.gRgasgagcalculator:gPerformgsomegarithmeticgoperationsgingR.gg
4.gDemonstrategthegprocessgofgcreatinggagusergdefinedgfunctiongingR.gg
5.gPerformgsomeglogicalgoperationsgingR.gg
6.gWritegangRgscriptgtogchangegthegstructuregofgagDatagframe.gg
7.gWritegangRgscriptgtogdemonstrategloops.gg
8.gWritegangRgscriptgtogdemonstrategconditionalgstatements:gif,gifgelse,gswitch.gg
9.gWritegangRgscriptgtogconvertgagvectorgtogfactors.gg
10.gWritegangRgscriptgtogexpandgagdatagframe.ggR-gg
11.gWritegangRgscriptgtogdemonstrategRgobjects.gg
12.gDemonstrategthegfollowinggaggregategfunctionsgingR:gsum,gmean,gcount,gmin,gmax.gg
13.gWritegangRgscriptgtogreadgandgwritegdifferentgfiles.gg
14.gWritegangRgscriptgtogfindgsubsetgofgagdataset.gg
15.gElucidategthegprocessgofgdatagexplorationgingRgusinggread(),summary(),nrow(),ncol(),str(). gg
16.gWritegangRgscriptgtoghandlegmissinggvaluesgingagdataset.gg
17.gWritegangRgscriptgtoghandlegoutliers.gg
18.gWritegangRgscriptgtoghandleginvalidgvalues.gg
19.gVisualizegirisgdatasetgusinggmosaicgplot.gg
20.gVisualizegcorrelationgbetweengsepalglengthgandgpetalglengthgingirisgdatagsetgusinggscattergplot.gg
21.gLineargRegression:gConsidergthegfollowinggmicegdata:gHeight:g140,g142,g150,g147,g139,g152,g154,g135,g148,g147.gWe
ight:g59,g61,g66,g62,g57,g68,g69,g58,g63,g62.gDerivegrelationshipgcoefficientsgandgsummarygforgthegabovegdata.g
g22.gConsidergthegabovegdatagandgpredictgthegweightgofgagmousegforgaggivengheightgandgplotgthegresultsgusinggaggraph.gg
23.gLogisticgRegression:gAnalysegirisgdatagsetgusinggLogisticgRegression.gNote:gcreategagsubsetgofgirisgdatasetgwithgtwogs
pecies.gg
24.gPerformgLogisticgRegressionganalysisgongthegabovegmicegdata(Sl.No.21)gandgplotgthegresults.gg
25.gDecisiongTree:gImplementgID3galgorithmgingR.gg
26.gImplementgC4.5galgorithmgingR.gg
27.gTimegSeries:gWritegRgscriptgtogdecomposegtimegseriesgdatagintograndom,gtrendgandgseasonalgdata.g
28.gWritegRgscriptgtogforecastgtimegseriesgdatagusinggsinglegexponentialgsmoothinggmethod.gg
29.gClustering:gImplementgK-meansgalgorithmgingR.gg
30.gImplementgCUREgalgorithmgingR.g
1. Downloading,ginstallinggandgsettinggpathgforgR.
LocalgEnvironmentgSetup
IfgyougaregstillgwillinggtogsetgupgyourgenvironmentgforgR,gyougcangfollowgthegstepsggivengbelow.
WindowsgInstallation
YougcangdownloadgthegWindowsginstallergversiongofgRgfromgR-
3.2.2gforgWindowsg(32/64gbit)gandgsavegitgingaglocalgdirectory.