| Title: | Tạo đáp án bài tập thống kê |
|---|---|
| Description: | Gói lệnh tạo mẫu đáp án các câu hỏi thống kê dưới dạng mã nguồn latex để copy vào mẫu đáp án có sẵn |
| Authors: | Vũ Ngọc Bình [aut, cre] (ORCID: no Id) |
| Maintainer: | Vũ Ngọc Bình <[email protected]> |
| License: | `use_mit_license()` |
| Version: | 0.18 |
| Built: | 2026-06-04 08:44:29 UTC |
| Source: | https://github.com/vungocbinh2009/thongke.dapan |
Hàm này tính tất cả các giá trị tổng giữa x và y
answer_calculate_sum(data, intro = "", score = 1)answer_calculate_sum(data, intro = "", score = 1)
Hàm này in ra đáp án cho bài toán tính hệ số tương quan
answer_correlation(data, score = 1, round_digits = 4)answer_correlation(data, score = 1, round_digits = 4)
Hàm này dùng để tạo đáp án tùy ý, theo nhu cầu của người dùng.
answer_custom(templates, scores, data)answer_custom(templates, scores, data)
templates: |
Một vector chứa mẫu đáp án |
scores: |
Một vector chứa điểm số cho từng mục. |
data: |
Một list chứa dữ liệu để thêm vào template. |
Hàm này in ra đáp án cho bài toán ước lượng giá trị trung bình (dùng phân bố chuẩn) answer là lời giải của bài toán.
answer_estimate_mean_norm( data, sd_symbol = "\\sigma", answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )answer_estimate_mean_norm( data, sd_symbol = "\\sigma", answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán ước lượng giá trị trung bình (dùng phân bố Student) answer là lời giải của bài toán.
answer_estimate_mean_t( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )answer_estimate_mean_t( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán ước lượng cho tỷ lệ answer là lời giải của bài toán.
answer_estimate_prop( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )answer_estimate_prop( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán ước lượng phương sai answer là lời giải của bài toán.
answer_estimate_var( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )answer_estimate_var( data, answer = "Khoảng tin cậy cần tìm là:", score = c(0.5, 1.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán hồi quy tuyến tính đơn
answer_linear_regression(data, intro = "", score = c(1, 0.5), round_digits = 4)answer_linear_regression(data, intro = "", score = c(1, 0.5), round_digits = 4)
Hàm này in ra đáp án cho bài toán tìm giá trị dự báo của Y dựa trên mô hình hồi quy tuyến tính.
answer_linear_regression_predict( data, answer = "Giá trị cần dự đoán là:", value_unit = "", score = 0.5, round_digits = 4 )answer_linear_regression_predict( data, answer = "Giá trị cần dự đoán là:", value_unit = "", score = 0.5, round_digits = 4 )
Hàm in đáp án bài toán tính giá trị trung bình
answer_mean( data, answer = "Giá trị trung bình là: ", score = 1, round_digits = 4 )answer_mean( data, answer = "Giá trị trung bình là: ", score = 1, round_digits = 4 )
data: |
là 1 vector dữ liệu |
answer: |
câu trả lời của bài toán |
score: |
Đáp số cho câu hỏi này. |
Hàm này dùng để ghép đáp án từ nhiều hàm có sẵn trở thành 1 đáp án duy nhất
answer_merge(templates)answer_merge(templates)
templates |
Một vector chứa các template cần ghép. |
Hàm này in ra đáp án cho bài toán xác định kích thước mẫu (với giá trị trung bình) conclusion là một hàm in ra kết quả cuối cùng của bài toán, với 1 tham số chính là kết quả của phép tính.
answer_sample_size_mean( data, sd_symbol = "\\sigma", conclusion = function(value) { return(sprintf("%d", value)) }, score = c(0.5, 1, 0.5), round_digits = 4 )answer_sample_size_mean( data, sd_symbol = "\\sigma", conclusion = function(value) { return(sprintf("%d", value)) }, score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán xác định kích thước mẫu (với tỷ lệ, khi đã biết f) conclusion là một hàm in ra kết quả cuối cùng của bài toán, với 1 tham số chính là kết quả của phép tính.
answer_sample_size_prop_1( data, score = c(0.5, 1, 0.5), conclusion = function(value) { return(sprintf("%d", value)) }, round_digits = 4 )answer_sample_size_prop_1( data, score = c(0.5, 1, 0.5), conclusion = function(value) { return(sprintf("%d", value)) }, round_digits = 4 )
Hàm này in ra đáp án cho bài toán xác định kích thước mẫu (với tỷ lệ, khi chưa biết f) conclusion là một hàm in ra kết quả cuối cùng của bài toán, với 1 tham số chính là kết quả của phép tính.
answer_sample_size_prop_2( data, score = c(0.5, 1, 0.5), conclusion = function(value) { return(sprintf("%d", value)) }, round_digits = 4 )answer_sample_size_prop_2( data, score = c(0.5, 1, 0.5), conclusion = function(value) { return(sprintf("%d", value)) }, round_digits = 4 )
Hàm này in đáp án cho bài toán tính giá trị độ lệch chuẩn
answer_sd( data, answer = "Giá trị độ lệch chuẩn là: ", with_mean = TRUE, score = 1, round_digits = 4 )answer_sd( data, answer = "Giá trị độ lệch chuẩn là: ", with_mean = TRUE, score = 1, round_digits = 4 )
data: |
là 1 vector dữ liệu |
answer: |
câu trả lời của bài toán |
score: |
Đáp số cho câu hỏi này. |
Hàm này in ra đáp án cho bài toán KĐGT về so sánh 2 giá trị trung bình (phân bố chuẩn)
answer_test_2_mean_norm( data, sd_symbol = "\\sigma", conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_2_mean_norm( data, sd_symbol = "\\sigma", conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về so sánh 2 giá trị trung bình (phân bố Student)
answer_test_2_mean_t( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_2_mean_t( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về so sánh 2 tỷ lệ.
answer_test_2_prop( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_2_prop( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán kiểm định sự phù hợp của k tỷ lệ.
answer_test_goodness_of_fit( data, h0, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_goodness_of_fit( data, h0, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán kiểm định tính độc lập.
answer_test_independent( data, h0, row_names, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_independent( data, h0, row_names, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về so sánh k tỷ lệ.
answer_test_k_prop( data, h0, row_names, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_k_prop( data, h0, row_names, col_names, conclusion_h0 = "", conclusion_h1 = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về giá trị trung bình (phân bố chuẩn)
answer_test_mean_norm( data, sd_symbol = "\\sigma", conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_mean_norm( data, sd_symbol = "\\sigma", conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về giá trị trung bình (phân bố Student)
answer_test_mean_t( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_mean_t( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in ra đáp án cho bài toán KĐGT về tỷ lệ
answer_test_prop( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )answer_test_prop( data, conclusion_h0 = "", conclusion_h1 = "", intro = "", score = c(0.5, 1, 0.5), round_digits = 4 )
Hàm này in đáp án cho bài toán tính phương sai
answer_var( data, answer = "Giá trị phương sai là: ", with_mean = TRUE, score = 1, round_digits = 4 )answer_var( data, answer = "Giá trị phương sai là: ", with_mean = TRUE, score = 1, round_digits = 4 )
data: |
là 1 vector dữ liệu |
answer: |
câu trả lời của bài toán |
with_mean: |
Có tính phương sai dựa trên giá trị trung bình không? |
score: |
Đáp số cho câu hỏi này. |
Hàm này đưa ra kết luận cho bài toán kiểm định giả thiết
get_conclusion(rejected, operator)get_conclusion(rejected, operator)
Hàm này lấy đường dẫn các file trong package
get_file_path(...)get_file_path(...)
Hàm này dùng để tạo template cho việc tạo đề thi bằng thongke.dapan
init_template()init_template()
Hàm này dùng thư viện whisker để render file
render_template(file_name, var_list)render_template(file_name, var_list)
Hàm này giúp việc trả về 1 list đơn giản hơn
return_list(...)return_list(...)