Obs months 1 2 2 2 3 6 4 2 I want to merge the dataset above with other datasets based on value of months variable. For example, I want to merge two months of data for the first record, two months of data for the second record, 6 months of data for the third record, and 2 months of records for the fourth record. Is there a systematic way of doing it? I was thinking about creating a variable based on the months variable and create a loop within a macro to achieve it.
... View more
I have the following data, How I can create the multiple records based on the horizontal data , depening on the time variables. thank you for your help.
Assumptions:
1. if all four time vairables avaialble then need two records with startdate time and stopdate time depending the on the time
Example first and second rows. only difference between first and second row is column D and E have same time
2. when "restarttime" missing consider the "intermediatestopTime as "restarttime"( and vice versa) and create two records.
3. when "intermediatestoptime" and "restartime" missing then create one record for "stopdatetime" and "startdatetime".
data have;
format date date9. starttime time8. intermediatestoptime time8. restarttime time8. finalstoptime time8.;
do i = 1 to 4;
usubjid = "00-01";
date = '01OCT2024'd;
/* Generate different times for each record */
starttime = '12:20:00't + (i-1)*600; /* Increment start time by 10 minutes each iteration */
intermediatestoptime = starttime + 600; /* Intermediate stop time is 10 minutes after start time */
restarttime = intermediatestoptime + 600; /* Restart time is 10 minutes after intermediate stop time */
finalstoptime = restarttime + 600; /* Final stop time is 10 minutes after restart time */
output;
end;
drop i;
run;
data have1;
set have;
if _n_ =2 then restarttime = '12:40:00't;
if _n_ =3 then restarttime = '';
if _n_ =4 then do; restarttime = '';intermediatestoptime='';end;
run;
... View more
Hi I have a file uploaded to a big data platform showing correct d.p but somehow when our clients see the same file via ODBC, the decimal place change from 4 to 2, how did that happen? Do I need to setup schema for showing data via ODBC or there is specific settings required dealing with?
... View more
hello. I am a SAS beginner. I have an experimental group, and I need to build a control group. A control group must be created by matching control group subjects 1:1 based on two variables: age and sex of the experimental group. Matching should be done using only those two variables, not the propensity score. Should I use proc psmatch or inner join? I would appreciate it if you could provide detailed code.
... View more
Machine Learning 은 "명시적으로 프로그램을 작성하지 않고, 컴퓨터가 스스로 규칙을 학습하는 연구분야"를 의미합니다.
Machine Learning은 보통 3가지 유형으로 구분됩니다.
- Supervised Learning, Unsupervised Learning, Reinforcement Learning
그 중 Supervised Learning 에 대해서 알아보겠습니다.
1) Supervised Learning_지도학습
- 정답이 있는 데이터를 통해 데이터 분류 / 올바른 결과를 예측하는 것을 목표로 합니다.
- Supervised Learning에는 Regression / Classification 이 있습니다.
ⓛ Regression
영어 공부 시간과 시험점수 결과 데이터가 있습니다. 영어 공부 시간에 따라 시험점수가 결정된다라고 생각합니다.
그렇다면 9시간 영어 공부를 한 결과 시험 점수는 몇 점일까?
위 문항이 Regression 의 예시입니다.
즉, 변수들 간의 상관관계를 찾는 것, 연속적인(Continous) 데이터로부터 결과를 예측하는 것 이다.
예측 결과가 숫자 일 때 사용합니다.
data hour_score;
input hour score;
datalines;
1 11
3 43
6 56
8 60
run;
proc sgplot data = hour_score;
scatter Y = score X = hour / markerattrs=(size=30);
run;
② Classification
시청한 tv 프로그램에 따라 선호도를 조사하였습니다.
새로운 tv 프로그램 A의 선호도는 무엇일까?
tv 프로그램의 속성에는 감독, 배우, 코믹성 등 다양한 속성이 있을 수 있습니다.
속성들을 파악해 새로운 tv 프로그램의 선호도를 예측할 수 있습니다.
즉, 주어진 데이터를 범주(category)에 따라 분류합니다.
예측 결과가 숫자가 아닐 때 사용하는 방법입니다
... View more