Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8138321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:27:20+00:00 2026-06-06T11:27:20+00:00

I have the following data set structure: date time_in_hours price Sep 03 08 9.76

  • 0

I have the following data set structure:

date    time_in_hours   price   
Sep 03 08   9.76            98  
Sep 03 08   10.43           97  
Sep 03 08   10.98           96      
Sep 03 08   11.48           99      
Sep 04 08   2.35            98      
Sep 04 08   2.58            98.45       
Sep 04 08   3.45            96.3        
Sep 04 08   3.89            96.25       
Sep 04 08   4.18            100     
Sep 05 08   12.65           101     
Sep 05 08   12.96           100.25      
Sep 05 08   13.25           104.35      
Sep 05 08   13.78           98      

My data is for the years 2008 and 2009. It contains a total of 504 trading days.
My objective is to interpolate prices at every half hour (eg 9.5 10 10.5 11 11.5…etc.) only for time interval between 9.5 and 16.

I have been struggling with the command interpolate / aggregate given that I must interpolate for a specific time interval for each calendar date. My final output must also contain the date, time, and price. Something like this:

date    time_in_hours   price   
Sep 03 08   10           98  
Sep 03 08   10.5         97  
Sep 03 08   11           96      
Sep 03 08   11.5         99      
Sep 04 08   2.5          98      
Sep 04 08   3            98.45     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:27:21+00:00Added an answer on June 6, 2026 at 11:27 am

    The code below gives you the output you have stated, but based on all comments above I am not sure it is going to solve your problem completely. Note that round(x, 0.5) takes 0.25 as the boundary – so 2.74 becomes 2.5 while 2.75 becomes 3.

    data test;
    infile datalines dsd;
    input date :$20. time_in_hours price;
    datalines;
    Sep 03 08,9.76,98
    Sep 03 08,10.43,97
    Sep 0308,10.98,96
    Sep 03 08,11.48,99
    Sep 04 08,2.35,98
    Sep 04 08,2.58,98.45
    Sep 04 08,3.45,96.3
    Sep 04 08,3.89,96.25
    Sep 04 08,4.18,100
    Sep 05 08,12.65,101
    Sep 05 08,12.96,100.25
    Sep 05 08,13.25,104.35
    Sep 05 08,13.78,98
    ;
    run;
    
    proc print;
    run;
    
    data test2;
        set test(rename = (time_in_hours = old_time_in_hours));
        time_in_hours = round(old_time_in_hours, 0.5);
        if (9.5 <= time_in_hours <= 16);
    run;
    
    proc print;
    run;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following data set: structure(list(Geschaeft = c(0.0961028525512254, 0.0753516756309475, 0, 0.0722803347280335, 0, 0.000877706260971328),
I have the following data structure: public class Person { public string Name{get;set;} public
I have the following data set that I am trying to plot with ggplot2,
I have the following set of data: ID | CREATED | USER -------------------------- 1
I have the swiss data set provided by R, which has the following form:
I have following data frames > head(elo) date elo 1 1921-12-18 1597 2 1922-05-14
I need a data structure of some sort to do the following: One set
I have the following data structure: public class Difference { public Difference() { }
I wonder if it is possible to have the following data structure in a
Based on couple of Api Calls I have constructed the following data structure (Dictionary).

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.