Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 4.50 KB | None | 0 0
  1. setwd("E:/00 Materiale facultate/Anul II/Semestrul II/Micro manageriala/tema")
  2. google<-read.table(file="valori google.txt",header=TRUE,sep="\t")
  3. attach(google)
  4. fix(google)
  5. microsoft<-read.table(file="valori microsoft.txt",header=TRUE,sep="\t")
  6. attach(microsoft)
  7. fix(microsoft)
  8. nasdaq<-read.table(file="valori nasdaq.txt",header=TRUE,sep="\t")
  9. attach(nasdaq)
  10. fix(nasdaq)
  11. summary(microsoft)
  12. summary(google)
  13. summary(nasdaq)
  14. tabel<-data.frame(microsoft$Date,microsoft$Close,microsoft$Volume,google$Close,google$Volume,nasdaq$Close,nasdaq$Volume)
  15. attach(tabel)
  16. fix(tabel)
  17. summary(tabel$`Microsoft Close`)
  18. summary(tabel$`Microsoft Volume`)
  19. summary(tabel$`Google Close`)
  20. summary(tabel$`Google Volume`)
  21. summary(tabel$`Nasdaq Close`)
  22. summary(tabel$`Nasdaq Volume`)
  23. mmc<-mean(tabel$`Microsoft Close`)
  24. mmv<-mean(tabel$`Microsoft Volume`)
  25. mgc<-mean(tabel$`Google Close`)
  26. mgv<-mean(tabel$`Google Volume`)
  27. mnc<-mean(tabel$`Nasdaq Close`)
  28. mnv<-mean(tabel$`Nasdaq Volume`)
  29. smc<-sd(tabel$`Microsoft Close`)
  30. smv<-sd(tabel$`Microsoft Volume`)
  31. sgc<-sd(tabel$`Google Close`)
  32. sgv<-sd(tabel$`Google Volume`)
  33. snc<-sd(tabel$`Nasdaq Close`)
  34. snv<-sd(tabel$`Nasdaq Volume`)
  35. cvmc<-smc/mmc
  36. cvmv<-smv/mmv
  37. cvgc<-sgc/mgc
  38. cvgv<-sgv/mgv
  39. cvnc<-snc/mnc
  40. cvnv<-snv/mnv
  41. library(moments)
  42. skmc<-skewness(tabel$`Microsoft Close`)
  43. skmv<-skewness(tabel$`Microsoft Volume`)
  44. skgc<-skewness(tabel$`Google Close`)
  45. skgv<-skewness(tabel$`Google Volume`)
  46. sknq<-skewness(tabel$`Nasdaq Close`)
  47. sknv<-skewness(tabel$`Nasdaq Volume`)
  48. kumc<-kurtosis(tabel$`Microsoft Close`)
  49. kumv<-kurtosis(tabel$`Microsoft Volume`)
  50. kugc<-kurtosis(tabel$`Google Close`)
  51. kugv<-kurtosis(tabel$`Google Volume`)
  52. kunc<-kurtosis(tabel$`Nasdaq Close`)
  53. kunv<-kurtosis(tabel$`Nasdaq Volume`)
  54. par(mfrow=c(3,2))
  55. hist(tabel$`Microsoft Close`,freq=FALSE, main="Histograma preturilor de inchidere a actiunii Microsoft", col="magenta4", xlab="Preturile de inchidere")
  56. lines(density(tabel$`Microsoft Close`))
  57. hist(tabel$`Microsoft Volume`,freq=FALSE, main="Histograma volumului tranzactiilor actiunii Microsoft", col="red4", xlab="Volumul tranzactiilor")
  58. lines(density(tabel$`Microsoft Volume`))
  59. hist(tabel$`Google Close`,freq=FALSE,main="Histograma preturilor de inchidere a actiunii Google", col="tan4", xlab="Preturile de inchidere")
  60. lines(density(tabel$`Google Close`))
  61. hist(tabel$`Google Volume`,freq=FALSE,main="Histograma volumului tranzactiilor actiunii Google", col="blue4", xlab="Volumul tranzactiilor")
  62. lines(density(tabel$`Google Volume`))
  63. hist(tabel$`Nasdaq Close`,freq=FALSE,  main="Histograma preturilor de inchidere a indicatorului Nasadaq", col="olivedrab4", xlab="Preturile de inchidere")
  64. lines(density(tabel$`Nasdaq Close`))
  65. hist(tabel$`Nasdaq Volume`,freq=FALSE, main="Histograma volumului tranzactiilor indicatorului Nasdaq", col="turquoise4", xlab="Volumul tranzactiilor")
  66. lines(density(tabel$`Nasdaq Volume`))
  67. tabelfaradata<-data.frame(microsoft$Close,microsoft$Volume,google$Close,google$Volume,nasdaq$Close,nasdaq$Volume)
  68. attach(tabelfaradata)
  69. fix(tabelfaradata)
  70. corelatii<-cor(tabelfaradata)
  71. corelatii
  72. library(corrplot)
  73. corrplot(corelatii,method="square")
  74. par(mfrow=c(3,2))
  75. boxplot(tabel$`Microsoft Close`,main="Boxplot preturi de inchidere a actiunii Microsoft",col="khaki")
  76. boxplot(tabel$`Microsoft Volume`,main="Boxplot volum tranzactii a actiunii Microsoft",col="slateblue4")
  77. boxplot(tabel$`Google Close`,main="Boxplot preturi de inchidere a actiunii Google",col="plum4")
  78. boxplot(tabel$`Google Volume`,main="Boxplot volum tranzactii a actiunii Google",col="rosybrown4")
  79. boxplot(tabel$`Nasdaq Close`,main="Boxplot preturi de inchidere a indicatorului Nasdaq",col="darkseagreen4")
  80. boxplot(tabel$`Nasdaq Volume`,main="Boxplot volum tranzactii a indicatorului Nasdaq",col="orchid4")
  81. par(mfrow=c(3,2))
  82. plot.ts(tabel$`Microsoft Close`,main="Trendul pretului de inchidere a actiunii Microsoft", col="magenta4", xlab="Zile",ylab="Pret")
  83. plot.ts(tabel$`Microsoft Volume`,main="Trendul volumului tranzactionat a actiunii Microsoft", col="red4", xlab="Zile",ylab="Volum")
  84. plot.ts(tabel$`Google Close`,main="Trendul pretului de inchidere a actiunii Google", col="tan4", xlab="Zile",ylab="Pret")
  85. plot.ts(tabel$`Google Volume`,main="Trendul pretului de inchidere a actiunii Google", col="blue4", xlab="Zile",ylab="Volum")
  86. plot.ts(tabel$`Nasdaq Close`,main="Trendul pretului de inchidere a indicatorului Nasdaq", col="olivedrab4", xlab="Zile",ylab="Pret")
  87. plot.ts(tabel$`Nasdaq Volume`,main="Trendul pretului de inchidere a indicatorului Nasdaq", col="turquoise4", xlab="Zile",ylab="Volum")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement