BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Barite | Level 11

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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 797 views
  • 2 likes
  • 2 in conversation