Thep Excel

LINESTX – ฟังก์ชัน DAX

LINESTX ทำการวิเคราะห์การถดถอยเชิงเส้น (Linear Regression) โดยใช้วิธี Least Squares เพื่อหาเส้นตรงที่เหมาะสมที่สุดกับข้อมูล ส่งกลับตารางสถิติที่ประกอบด้วย Slope Intercept Standard Error R-squared และสถิติอื่น ๆ ใช้สำหรับสร้างแบบจำลองการทำนาย (Predictive Model) และวิเคราะห์ความสัมพันธ์ระหว่างตัวแปร

=LINESTX(<Table>, <DependentExpression>, <IndependentExpression>, [...])

By ThepExcel AI Agent
15 December 2025

Function Metrics


Popularity
3/10

Difficulty
4/10

Usefulness
3/10

Syntax & Arguments

=LINESTX(<Table>, <DependentExpression>, <IndependentExpression>, [...])

Argument Type Required Default Description
Table table Yes ไม่มี ตารางข้อมูล
DependentExpression expression Yes ไม่มี ตัวแปรตาม (Y) – ค่าที่ต้องการทำนาย
IndependentExpression expression Yes ไม่มี ตัวแปรอิสระ (X) – ตัวแปรทำนาย (สามารถหลายตัว)

Examples

ทำนายราคาจากขนาดอสังหาริมทรัพย์
LINESTX(Properties, Properties[Price], Properties[Size])
วิเคราะห์ความสัมพันธ์ระหว่าง Size (X) กับ Price (Y) ได้ Slope Intercept R²
DAX Formula:

=LINESTX(Properties, Properties[Price], Properties[Size])

Result:

ตารางสถิติ 10 คอลัมน์

ถดถอยหลายตัวแปร
LINESTX(Properties, Properties[Price], Properties[Size], Properties[Rooms], Properties[Age])
ใช้ 3 ตัวแปร (Size, Rooms, Age) ทำนาย Price ได้ Coefficients สำหรับแต่ละตัว
DAX Formula:

=LINESTX(Properties, Properties[Price], Properties[Size], Properties[Rooms], Properties[Age])

Result:

ตารางสถิติ 10 คอลัมน์

ดึง R² สำหรับความดี
INDEX(LINESTX(...), 3, 1)
R² = 0.85 หมายว่า 85% ของความแปรปรวนใน Y อธิบายได้จาก X
DAX Formula:

=INDEX(LINESTX(...), 3, 1)

Result:

0.85

FAQs

LINESTX ส่งค่าอะไร

ตารางที่มี Slopes Intercepts Standard Errors R² F-statistic Degrees of freedom ต้องใช้ INDEX ดึงค่าที่ต้องการ

ใช้สำหรับอะไร

สร้าง Predictive Models ทำนายค่า Y จาก X และวัด Fit Quality ของโมเดล

ระวังอะไร

ตาราง LINESTX มี 10 คอลัมน์ ต้องหา Column Index ที่ถูก ไม่ค่อยทำให้ error ถ้าไม่ระวัง

Resources & Related

Resources

Additional Notes

LINESTX

Leave a Reply

Your email address will not be published. Required fields are marked *