SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.

Hello Experts,

I have a code on R  ( I do not code on R):

#if(noms == "Real Estate")
if(noms == Qimmo)
{
interpolation <- c()
date_affichage <- c()

for(annee in 1:(dim(tableau)[1]-1))
{
date_interpolation <- format(seq(as.Date(tableau$Date[annee], "%d/%m/%Y"), as.Date(tableau$Date[annee+1], "%d/%m/%Y"), by="days"), format = "%d/%m/%Y")
interpolation <- c(interpolation, approx(x = annee:(annee+1), y = tableau$Valeur[annee:(annee+1)], n=length(date_interpolation))$y )
date_affichage <- c(date_affichage, date_interpolation)
}

tableau <- data.frame(Date = unique(date_affichage), Valeur = unique(interpolation))
}


Do you know, please, the equivalent of this function on SAS please ? On Internet I have a lot of results, but I don't know which one is correct.

 

I have joined the data : I would like to have the values for all days in the year.

 

Thank you for your help !

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I don't know R either, and all you say to point us in the right direction is these few words in the title: "Linear interpolation for annual data". You can follow these instructions: https://support.sas.com/kb/24/560.html



--
Paige Miller

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I don't know R either, and all you say to point us in the right direction is these few words in the title: "Linear interpolation for annual data". You can follow these instructions: https://support.sas.com/kb/24/560.html



--
Paige Miller
SASdevAnneMarie
Barite | Level 11
Thank you,
My prolem is that I don't know how to do the linear interpolation for annual data. I have joined the data to my e-mail.
PaigeMiller
Diamond | Level 26

@SASdevAnneMarie wrote:

My prolem is that I don't know how to do the linear interpolation for annual data. I have joined the data to my e-mail.

I guess I don't understand why you say that you don't know how ... the link I gave offers actual SAS code to do linear interpolation.

--
Paige Miller
SASdevAnneMarie
Barite | Level 11
Thank you!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1175 views
  • 2 likes
  • 2 in conversation