Cant read my data

When I loaded my data (DD) , summary(DD) its ok , but when i wrote data (DD) . i see this error Warning message:
In data(DD) : data set ‘DD’ not found

head(DD) ok
str(DD) ok

The data() function loads data sets. If you want to print DD, you can use either of these commands

print(DD)
# or
DD

I see data but cant use it
data("DX$oilwti,DX$gold,DX$sp500")
and see this error
Warning message:
In data("DX$oilwti,DX$gold,DX$sp500") :
data set ‘DX$oilwti,DX$gold,DX$sp500’ not found

You should not be using the data() function for whatever you are trying to do. Please show the exact code that you use to load the data and then explain what you want to do with the data. From what you haveposted so far, it seems you have two data obejects, DD and DX and that is confusing.

library(readxl)
DX <- read_excel("C:/Users/DELL/Desktop/Dynamic linkages between strategic/OIL_GOLD/DX.xlsx")
View(DX)

Thank you for posting the code. Now, what do you want to do with DX?

I have three variables there so need to do forecasting
gold , oil , sp500

like this project
https://rpubs.com/subasish/537472

It looks to me like you have successfully read the data into DX. Doing something like the analysis in the blog post is a big job and very different than the point of this thread, which was reading the data. I suggest you start a new thread asking about forecasting. Explain which quantity you want to predict and the size and structure of your data. Showing the output of the command

summary(DX)

can be very helpful. Even better would be preparing a reproducible example as explained in the link below. That might be difficult but do try to give as much information about the data as possible.

1 Like

summary(DX)
oilwti gold sp500
Min. : 21.51 Min. :1052 Min. :1023
1st Qu.: 52.05 1st Qu.:1226 1st Qu.:1402
Median : 69.12 Median :1309 Median :2006
Mean : 71.81 Mean :1356 Mean :1992
3rd Qu.: 93.13 3rd Qu.:1482 3rd Qu.:2473
Max. :113.93 Max. :1874 Max. :3380

str(DX)
tibble [533 x 3] (S3: tbl_df/tbl/data.frame)
oilwti: num [1:533] 78 74.5 72.9 71.2 74.1 ... gold : num [1:533] 1130 1089 1083 1052 1090 ...
$ sp500 : num [1:533] 1136 1092 1074 1066 1076 ...

The results of summary() and str() are very helpful for understanding your data. For someone to help you further, you need to start a new topic about forecasting. That is especially important because I have never done forecasting and I cannot help with that. The first thing people will ask will be about the time values for your data. Forecasting can only be done if one of the variables represents time. I can guess that your data represent about 10 years of weekly values but you need to present the data with the time values included or at least explained. In the new thread, do include the output of summary() and str().

Yes. Without dates, I don't see how a forecast can be done.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.